ComponentFactory.Krypton.Ribbon.MaskedTextBoxController.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 masked textbox take the focus
            if (_maskedTextBox.LastMaskedTextBox.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 masked textbox 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
                _maskedTextBox.LastMaskedTextBox.MaskedTextBox.Focus();

                // If the masked textbox is inside a popup window
                if (_maskedTextBox.LastParentControl is VisualPopupGroup)
                {
                    // Ensure that the previous ribbon focus is restored when the popup window is dismissed
                    VisualPopupGroup popupGroup = (VisualPopupGroup)_maskedTextBox.LastParentControl;
                    popupGroup.RestorePreviousFocus = true;
                }
            }
        }