ComponentFactory.Krypton.Ribbon.DomainUpDownController.KeyTipSelect C# (CSharp) 메소드

KeyTipSelect() 공개 메소드

Perform actual selection of the item.
public KeyTipSelect ( KryptonRibbon ribbon ) : void
ribbon KryptonRibbon Reference to owning ribbon instance.
리턴 void
        public void KeyTipSelect(KryptonRibbon ribbon)
        {
            // Can the numeric up-down take the focus
            if (_domainUpDown.LastDomainUpDown.CanFocus)
            {
                // Prevent the ribbon from killing keyboard mode when it loses the focus,
                // as this causes the tracking windows to be killed and we want them kept
                ribbon.LostFocusLosesKeyboard = false;

                // Prevent the restore of focus when we fill the keyboard mode, as the focus
                // has been placed on the numeric up-down and so focus is allowed to change
                ribbon.IgnoreRestoreFocus = true;

                // Exit the use of keyboard mode
                ribbon.KillKeyboardMode();

                // Push focus to the specified target control
                _domainUpDown.LastDomainUpDown.DomainUpDown.Focus();

                // If the numeric up-down is inside a popup window
                if (_domainUpDown.LastParentControl is VisualPopupGroup)
                {
                    // Ensure that the previous ribbon focus is restored when the popup window is dismissed
                    VisualPopupGroup popupGroup = (VisualPopupGroup)_domainUpDown.LastParentControl;
                    popupGroup.RestorePreviousFocus = true;
                }
            }
        }