I have searched on here and have not found exactly what I am looking for.
I am using a ContextMenuStrip, within this there is one menu item that is a checked/unchecked item. The structure is the following:
Top Level: Settings
Middle Level: Processing
Bottom Level: Manual processing
I can not find a way to access the Bottom level item, to set it as checked or unchecked.
Can anyone please help?
Not sure I’m following the question. Do you know the name of the “Bottom level item”? If so just reference it by name:
If you don’t know the name you can loop through the
ItemsorDropDownItems(depending on the MenuItem type) control collection to find the one you want.Edit:
Correct, ToolStripItem does not have a checked property. It is a base class for many tool strip objects, some of which do not support checking. In this case you are probably dealing with ToolStripMenuItems which do have a checked property.
Try this:
Again though each
Control(ToolStripMenuItem) has a name associated with it so it would be easier to use the original variable rather than going through theItemsproperty of the context menu strip.