Groups | Blog | Home
all groups > dotnet windows forms > march 2005 >

dotnet windows forms : ContextMenu - Underline Break between items



Claudio Grazioli
3/21/2005 9:42:11 AM
[quoted text, click to view]

I'm sure if I understand your question, but I think you want to add a
separator line between two menu items.
Two ways to do that:
1. In the designer
Just user "Insert Separator" instead of "Insert New" when right clicking on
the context menu

2. In the source code
MenuItem separatorItem = new MenuItem;
separatorItem.Text = "-"; // yes, this makes it a separator !!
contextMenu.MenuItems.Add(separatorItem);

hth
--
Claudio Grazioli
Phil Jones
3/21/2005 8:30:19 PM
With the pop-up ContextMenu class, I've seen instances where the menu has
divider underlines between items. I can't figure out how to get my items to
have divider lines however.

How is this done?

Thanks everyone!
===
Phil

Phil Jones
3/22/2005 3:03:45 PM
Ah ha!! Setting the text to "-". I would never have figured that out on my
lonesome.
====
Cheers Claudio!

AddThis Social Bookmark Button