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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a separator as a menu item

Status
Not open for further replies.

EwS

Programmer
Dec 30, 2002
398
US
When you create a menu on the form in the Design view, you can right click and select "Insert Separator".
Is there a way to create a separator that will look the same if I create the menu programmatically (maybe using a vb constant)?
This is how I do it right now, but as you can tell, it doesn't look the same:

Code:
Dim mnuSeparator As New MenuItem
mnuSeparator.Text = "---------------"
menu.MenuItems.Add(mnuSeparator)
 
You know how you type a hyphen in a text editor, such as Microsoft Word, and when you hit Enter at the end of the line, it makes the hyphen longer? So I used those hyphens when assigning mnuSeparator.Text property and now at least the separator doesn't appear as a dotted line. :)
 
Dim mnuSeparator As New MenuItem
mnuSeparator .Text = "-"
menu.MenuItems.Add(mnuSeparator)



Hope this is it
 
No, the single hyphen doesn't work.
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top