ComponentFactory.Krypton.Ribbon.VisualPopupGroup.SetPreviousFocusItem C# (CSharp) Method

SetPreviousFocusItem() public method

Set focus to the previous focus item inside the popup group.
public SetPreviousFocusItem ( ) : void
return void
        public void SetPreviousFocusItem()
        {
            // Find the previous item in sequence
            bool matched = false;
            ViewBase view = _viewGroup.GetPreviousFocusItem(ViewPopupManager.FocusView, ref matched);

            // Rotate around to the last item
            if (view == null)
                SetLastFocusItem();
            else
            {
                ViewPopupManager.FocusView = view;
                PerformNeedPaint(false);
            }
        }

Usage Example

Example #1
0
        private void KeyDownPopupGroup(VisualPopupGroup popupGroup, KeyEventArgs e)
        {
            switch (e.KeyData)
            {
            case Keys.Tab | Keys.Shift:
            case Keys.Left:
                popupGroup.SetPreviousFocusItem();
                break;

            case Keys.Tab:
            case Keys.Right:
                popupGroup.SetNextFocusItem();
                break;

            case Keys.Space:
            case Keys.Enter:
                OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));

                // Get access to the popup for the group
                if ((VisualPopupManager.Singleton.CurrentPopup != null) &&
                    (VisualPopupManager.Singleton.CurrentPopup is VisualPopupGroup))
                {
                    // Cast to correct type
                    VisualPopupGroup popup = (VisualPopupGroup)VisualPopupManager.Singleton.CurrentPopup;
                    popup.SetFirstFocusItem();
                }
                break;
            }
        }
All Usage Examples Of ComponentFactory.Krypton.Ribbon.VisualPopupGroup::SetPreviousFocusItem