-1

I want add divider between context menu items on system tray icon. This is my code:

    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;

Divider like is this one >> https://i.stack.imgur.com/pgksW.png

PSSGCSim
  • 1,247
  • 2
  • 18
  • 35

1 Answers1

1

cm.MenuItems.Add(new ToolStripSeparator()); should work

Keenan
  • 264
  • 3
  • 7