我想在系统托盘图标上的上下文菜单项之间添加分隔符。这是我的代码:
ContextMenu cm = new ContextMenu();
cm.MenuItems.Add("Resume", new EventHandler(MenuResume_Click));
cm.MenuItems.Add(); // Here i want the divider
cm.MenuItems.Add("Logout", new EventHandler(BTNExit_Click));
cm.MenuItems.Add("Logout and Quit", new EventHandler(BTNExit_Compl));
this.Hide();
NIControlPanel.Visible = true;
NIControlPanel.ContextMenu = cm;
像这样的分频器>> http://i.stack.imgur.com/pgksW.png
答案 0 :(得分:1)
cm.MenuItems.Add(new ToolStripSeparator());应该工作