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

writing menu editor dynamically ?

Status
Not open for further replies.

ooops

MIS
Dec 21, 2000
91
0
0
US
Hi all,

I wonder if I can add to menu editor by code ? Thanks
 
If you mean to add items to a menu from code -there is a way.
First you have to create a menu using the menu editor.
Create for example a menu item named mnuArray.
Set the index to 0 - that's how you create an array of menu items.
In code you can add as many elements as you like using Load statement. Here is the code:

Private Sub Command1_Click()
Load mnuArray(1)
mnuArray(1).Caption = "Added menu item"
End Sub

There are some limitations because the element 0 should be visible and you cannot choose the place for the loaded elements.
Hope that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top