Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add a horizontal break line between MenuItems 1

Status
Not open for further replies.

Alcar

Programmer
Sep 10, 2001
595
US
I am adding the menuitems to the contextMenu of a little system tray application. I would like to add a separator between two MenuItems... here is the code:

this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem1, this.menuItem2, this.menuItem5, this.menuItem3, this.menuItem4});

How can I tell it to put a horisontal separator between 2 MenuItems?

I have tried:

menuItem.BreakLine = true;

but that adds a vertical break and creates 2 columns of my popupmenu.

tia

 
hey,

try something like adding a "-" to the value of a menu item, just like adding "Open" or "Exit" under the "File" menu; .menuItem("-");

karmafree.
 
worked like a charm. Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top