views:

1620

answers:

1

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?

Thanks.

+3  A: 

I'm able to run code like this:

this.menuMain.Items.Add(new ToolStripSeparator());

without any trouble... What kind of error are you getting?

GWLlosa
I am using the GUI Designer and it tells me when I try to do '-' that 'Cannot add ToolStripSeparator to MenuStrip'
Malfist
That works when I add it to the MainForm.Designer.cs, thanks!
Malfist
Actually that doesn't work. It shows up in designer, but not when I actually run the program...
Malfist
I added mnuMain.Items.Insert(2, new ToolStripSeparator()); to get the desired effect.
Malfist