Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a horizontal separator in a MenuStrip

I can't seem to find any way to add a horizontal separator in a MenuStrip. Visual Studio complains Cannot add ToolStropSeparator to MenuStrip.

Any idea's how I can do this?

like image 215
Malfist Avatar asked Sep 08 '25 12:09

Malfist


1 Answers

In the space between the two fields you want separated by the divider, type:

-

then hit enter (in the designer)

If you need to do this programmatically you can use the same trick:

contextMenu1.MenuItems.Add(new MenuItem("-"));
like image 182
Gerard Avatar answered Sep 11 '25 01:09

Gerard