Esempio n. 1
0
 private void PerformButtonClick()
 {
     SWF.ToolStrip toolstrip = button.Owner;
     if (toolstrip.InvokeRequired)
     {
         toolstrip.BeginInvoke(new SWF.MethodInvoker(PerformButtonClick));
         return;
     }
     button.PerformButtonClick();
 }
            private void RestoreFocusInternal()
            {
                Debug.WriteLineIf(s_snapFocusDebug.TraceVerbose, "[ToolStrip.RestoreFocusFilter] Detected a click, restoring focus.");

                _ownerToolStrip.BeginInvoke(new BooleanMethodInvoker(_ownerToolStrip.RestoreFocusInternal), new object[] { ToolStripManager.ModalMenuFilter.InMenuMode });

                // PERF,

                Application.ThreadContext.FromCurrent().RemoveMessageFilter(this);
            }
Esempio n. 3
0
        private void PerformToggle(SWF.ToolStripButton button, SWF.CheckState state)
        {
            SWF.ToolStrip toolstrip = ((SWF.ToolStripButton)Provider.Component).Owner;
            if (toolstrip.InvokeRequired)
            {
                toolstrip.BeginInvoke(new PerformToggleDelegate(PerformToggle),
                                      new object [] { button, state });
                return;
            }

            button.CheckState = state;
        }
Esempio n. 4
0
 private void EnableToolStripControl(ToolStrip toolstrip, ToolStripComboBox cb, bool enable)
 {
     if (toolstrip.InvokeRequired)
     {
         EnableToolStripControlCallback d = new EnableToolStripControlCallback(EnableToolStripControl);
         toolstrip.BeginInvoke(d, new object[] { toolstrip, cb, enable });
     }
     else
     {
         cb.Enabled = enable;
     }
 }