private static bool ChangeSelection(ToolStrip start, ToolStrip toolStrip)
 {
     if ((toolStrip == null) || (start == null))
     {
         return false;
     }
     if (start == toolStrip)
     {
         return false;
     }
     if (ModalMenuFilter.InMenuMode)
     {
         if (ModalMenuFilter.GetActiveToolStrip() == start)
         {
             ModalMenuFilter.RemoveActiveToolStrip(start);
             start.NotifySelectionChange(null);
         }
         ModalMenuFilter.SetActiveToolStrip(toolStrip);
     }
     else
     {
         toolStrip.FocusInternal();
     }
     start.SnapFocusChange(toolStrip);
     toolStrip.SelectNextToolStripItem(null, toolStrip.RightToLeft != RightToLeft.Yes);
     return true;
 }
Esempio n. 2
0
        private static bool ChangeSelection(ToolStrip start, ToolStrip toolStrip) {
            if (toolStrip == null || start == null) {
                Debug.Assert(toolStrip != null, "passed in bogus toolstrip, why?");
                Debug.Assert(start != null, "passed in bogus start, why?");
                return false;
            }
            if (start == toolStrip) {
                return false;
            }
            if (ModalMenuFilter.InMenuMode) {
                if (ModalMenuFilter.GetActiveToolStrip() == start) {
                    ModalMenuFilter.RemoveActiveToolStrip(start);
                    start.NotifySelectionChange(null);
                }
                ModalMenuFilter.SetActiveToolStrip(toolStrip);
            }
            else {
                toolStrip.FocusInternal();
            }
            // copy over the hwnd that we want to restore focus to on ESC
            start.SnapFocusChange(toolStrip);

            toolStrip.SelectNextToolStripItem(null, toolStrip.RightToLeft != RightToLeft.Yes);
            return true;
        }