I have a MenuStrip in my form, so I add a ToolStripMenuItem to the MenuStrip.
The ToolStripMenuItem has a checkBox.
-------------------------------------------------------------
Now, The ToolStripMenuItem is checked.
I want: When I click The ToolStripMenuItem, The ToolStripMenuItem be unchecked, and when I back again and click The ToolStripMenuItem, The ToolStripMenuItem be checked.
I try this code, but doesnt work:
Expand|Select|Wrap|Line Numbers
- private void ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- if (ToolStripMenuItem.Checked.Equals(true) == true)
- {
- ToolStripMenuItem.Checked.Equals(false);
- }
- if (ToolStripMenuItem.Checked.Equals(false) == true)
- {
- ToolStripMenuItem.Checked.Equals(true);
- }
- }