Reputation: 1491
I need to programmatically cancel the dropdown of a ToolStripDropDownButton in the DropDownOpening event. However I cannot figure out a way to achieve this.
Upvotes: 0
Views: 962
Reputation: 61
You can clear all menu items in the opening event:
toolStripDropDownButton1.DropDownItems.Clear();
Upvotes: 0
Reputation: 35869
You can either do nothing in the opening event, or disable the control so I can't be interacted with to even generate the opening event:
toolStripDropDownButton.Enabled = false
http://msdn.microsoft.com/en-us/library/system.windows.forms.toolstripitem.enabled
Upvotes: 0