-1

我想在系统托盘图标上的上下文菜单项之间添加分隔线。这是我的代码:

    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

4

1 回答 1

1

cm.MenuItems.Add(new ToolStripSeparator()); 应该管用

于 2013-05-08T20:51:16.480 回答