Question Implementing a dynamic submenu on ToolStripMenuItem

ntaylor

Member
Joined
Sep 2, 2010
Messages
6
Programming Experience
10+
This seems like it should be a common problem, but so far I haven't found a solution. On my Windows Form I have created a menu object and populated it with ToolStripMenuItems. One of these items has a DropDown object attached. The DropDown should appear when the mouse hovers over the parent ToolStripMenuItem and disappear when the mouse leaves the ToolStripMenuItem *unless* it enters the DropDown at the same time.

Also, I don't want the DropDown to disappear when the user makes a selection in it, so I have set its "AutoClose" property to False.

This is where I'm stuck. If I set up a handler to close the DropDown when the mouse leaves the parent ToolStripMenuItem, it's impossible to use the DropDown, because it closes as soon as the user tries to hover over it. This seems like a common design - a drop down that appears / disappears when the mouse hovers over / leaves the parent element - so how is it normally done?
 
Top Bottom