我有一个ToolStripMenuItem
名为mailResultsToolStripMenuItem
. 现在我希望它是.Selected = true
当用户单击它以及.Selected = false
用户再次单击它时。我试过:
mailResultsToolStripMenuItem.Selected = true;
但它显示该属性是只读的错误。
你在找ToolStripMenuItem.Checked
吗?
// true if the ToolStripMenuItem is checked or is in an indeterminate state;
// otherwise, false. The default is false.
mailResultsToolStripMenuItem.Checked = true;
// Also interesting: mailResultsToolStripMenuItem.CheckState
// mailResultsToolStripMenuItem.CheckOnClick