Example #1
0
        public static Control GetFocusControl()
        {
            Control focusControl = null;
            IntPtr  focusHandle  = User32Interop.GetFocus();

            if (focusHandle != IntPtr.Zero)
            {
                focusControl = Control.FromHandle(focusHandle);
            }
            return(focusControl);
        }