ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGroup.GetNextFocusItem C# (CSharp) Method

GetNextFocusItem() public method

Gets the next focus item based on the current item as provided.
public GetNextFocusItem ( ViewBase current, bool &matched ) : ViewBase
current ViewBase The view that is currently focused.
matched bool Has the current focus item been matched yet.
return ViewBase
        public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
        {
            ViewBase view = null;

            if (Collapsed)
            {
                if (matched)
                    view = _layoutCollapsedMain;
                else
                    matched = (current == _layoutCollapsedMain);
            }
            else
                view = _layoutNormalContent.GetNextFocusItem(current, ref matched);

            return view;
        }

Usage Example

Example #1
0
        /// <summary>
        /// Set focus to the next focus item inside the popup group.
        /// </summary>
        public void SetNextFocusItem()
        {
            // Find the next item in sequence
            bool     matched = false;
            ViewBase view    = _viewGroup.GetNextFocusItem(ViewPopupManager.FocusView, ref matched);

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