AGS.Editor.Utilities.GetControlThatHasFocus C# (CSharp) Метод

GetControlThatHasFocus() публичный статический Метод

public static GetControlThatHasFocus ( ) : Control
Результат System.Windows.Forms.Control
        public static Control GetControlThatHasFocus()
        {
            Control focusControl = null;
            IntPtr focusHandle = GetFocus();
            if (focusHandle != IntPtr.Zero)
            {
                // returns null if handle is not to a .NET control
                focusControl = Control.FromHandle(focusHandle);
            }
            return focusControl;
        }

Usage Example

Пример #1
0
        private bool DoesThisPanelHaveFocus()
        {
            Control focused = Utilities.GetControlThatHasFocus();

            return(focused == this.ActiveControl);
        }