2

我有一个ToolStripMenuItem名为mailResultsToolStripMenuItem. 现在我希望它是.Selected = true当用户单击它以及.Selected = false用户再次单击它时。我试过:

mailResultsToolStripMenuItem.Selected = true;

但它显示该属性是只读的错误。

4

1 回答 1

1

你在找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
于 2012-10-02T14:51:46.763 回答