Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Leave ToolStripMenu Open After Clicking an Item

I'm creating a ToolStripMenu shown below that is supposed to allow the user to interact with the items "XML" and "Non XML" as though they are regular check boxes on a form. However, when one item is checked/unchecked the menu closes. How can I allow an item to be checked/unchecked without closing the menu? Or is there a different standard method of achieving the same behavior?

enter image description here

So what I want is to be able to click on "Non XML", show a check box and leave the menu open. The idea is that the last menu item will be "Done" and when it's clicked the "G2S" sub items will remain open but the "Display" sub items ( XML, Non XML ) will close.

Any ideas?

Note: I am aware that this is likely not the best user interface design. I'd like to know however how this could be accomplished just to gain some technical knowledge about handling menus.

like image 682
Chimera Avatar asked Dec 27 '22 14:12

Chimera


1 Answers

Interesting concept is described in this thread on Stackoverflow:

Here is the essence of the accepted answer:

ParentMenu.DropDown.AutoClose = false;

It does exactly what you are asking for - prevent menu from closing when subitem is clicked.

like image 98
Neolisk Avatar answered Jan 20 '23 10:01

Neolisk