ComponentFactory.Krypton.Ribbon.ComboBoxController.KeyTipSelect C# (CSharp) Method

KeyTipSelect() public method

Perform actual selection of the item.
public KeyTipSelect ( KryptonRibbon ribbon ) : void
ribbon KryptonRibbon Reference to owning ribbon instance.
return void
        public void KeyTipSelect(KryptonRibbon ribbon)
        {
            // Can the combobox take the focus
            if (_comboBox.LastComboBox.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 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
                _comboBox.LastComboBox.ComboBox.Focus();

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