Enable/Disable ToolstripButton Using Delegates (Thread) In C#
Assuming you will access the toolstrip button from another thread, then here's the code on how to enable or disable ToolstripButton using delegates.
Cheers!
delegate void EnableDisableButtonRunDeleg(bool value); private void EnableDisableButtonRun(bool value) { if (tsMenu.InvokeRequired) { this.tsMenu.Invoke(new EnableDisableButtonRunDeleg (EnableDisableButtonRun), value); } else { ToolStripItem ts = tsMenu.Items[0]; ((ToolStripButton)ts).Enabled = value; } }
Comments
Post a Comment