2
當我自定義右鍵菜單得益於此:點擊時定製Zedgraph ToolStripMenuItem不會檢查點擊
lineGraphControl1.ContextMenuBuilder += new ZedGraphControl.ContextMenuBuilderEventHandler(MyContextMenuBuilder);
而且
private void MyContextMenuBuilder(ZedGraphControl control, ContextMenuStrip menuStrip, Point mousePt, ZedGraphControl.ContextMenuObjectState objState)
{
// create a new menu item
ToolStripMenuItem item = new ToolStripMenuItem();
// This is the user-defined Tag so you can find this menu item later if necessary
item.Name = "simple_cursor";
// This is the text that will show up in the menu
item.Text = "Simple Cursor";
item.CheckOnClick = true;
// Add a handler that will respond when that menu item is selected
item.Click += new System.EventHandler(DisplaySimpleCursor);
// Add the menu item to the menu
menuStrip.Items.Add(item);
}
但菜單Simple Cursor
不會檢查。我試圖強制發件人在功能DisplaySimpleCursor()
,它不起作用。
當我調試我的應用程序,我看到在DisplaySimpleCursor()
,發件人的屬性檢查設置爲true。
我錯過了什麼?