views:

30

answers:

1

I have a ToolStrip. In my ToolStrip I have a ToolStripDropDownButton. My ToolStripDropDownButton has a DropDown of type ToolStripDropDown that contains a ToolStripControlHost which contains a Label. I have assigned a ContextMenuStrip to my Label. When I show the DropDown and right-click on the label, the ContextMenuStrip displays correctly, but the original DropDown is dismissed.

I can understand the existence of underlying code to prevent the display of two "ToolStripItems" at the same time and I'm assuming that's what I'm running in to here. Anybody know of a way around it?

A: 

Turns out this can be accomplished with creative use of the AutoClose property on the ToolStripDropDown class:

First, on Label Right Click, set AutoClose of the ToolStripDropDown to false and show context menu.
Second, on ContextMenu dismissal, reset AutoClose of the ToolStripDropDown to true.

Jacob G