コード例 #1
0
        private Control GetFocusedControl()
        {
            Control control = (Control)null;
            IntPtr  focus   = RadPopupContainerForm.GetFocus();

            if (focus != IntPtr.Zero)
            {
                control = Control.FromHandle(focus);
            }
            return(control);
        }
コード例 #2
0
        private static RadPopupContainerForm.KeyStates GetKeyState(Keys key)
        {
            RadPopupContainerForm.KeyStates keyStates = RadPopupContainerForm.KeyStates.None;
            short keyState = RadPopupContainerForm.GetKeyState((int)key);

            if (((int)keyState & 32768) == 32768)
            {
                keyStates |= RadPopupContainerForm.KeyStates.Down;
            }
            if (((int)keyState & 1) == 1)
            {
                keyStates |= RadPopupContainerForm.KeyStates.Toggled;
            }
            return(keyStates);
        }
コード例 #3
0
        protected virtual void SetFocusCore()
        {
            bool    forward = !RadPopupContainerForm.IsKeyDown(Keys.LShiftKey) && !RadPopupContainerForm.IsKeyDown(Keys.RShiftKey);
            Control ctl     = this.GetFocusedControl();

            do
            {
                if (!forward && ctl is System.Windows.Forms.TextBox && ctl.Parent is RadControl)
                {
                    ctl = ctl.Parent;
                }
                ctl = this.panel.GetNextControl(ctl, forward);
            }while (ctl != null && !ctl.CanSelect);
            if (ctl == null || !ctl.CanFocus)
            {
                return;
            }
            if (ctl is RadTextBox)
            {
                ctl = ((RadTextBoxBase)ctl).TextBoxItem.HostedControl;
            }
            ctl.Focus();
        }
コード例 #4
0
 public static bool IsKeyDown(Keys key)
 {
     return(RadPopupContainerForm.KeyStates.Down == (RadPopupContainerForm.GetKeyState(key) & RadPopupContainerForm.KeyStates.Down));
 }