How to change the checked state of a ToolStripItem in Winforms?
16,599
You need to cast to ToolStripMenuItem
:
((ToolStripMenuItem)menuItem).Checked = true;
Related videos on Youtube
Comments
-
Joan Venge almost 2 years
When I look it up, they list it as having a
.Checked
property. But both in Visual Studio and on msdn, it doesn't list any kid ofChecked
property.ContextMenuStrip menu = new ContextMenuStrip ( ); var menuItem = menu.Items.Add ( "CheckedItem" ); //menuItem.Checked?
Is there a way to do this?