Link to home
Start Free TrialLog in
Avatar of escheider
escheider

asked on

Creating VB Menus with code

Hello experts:

Id like to create a vb menu using code.  The data elements would be pulled from a database table.  I'm very comfortable with ado connectivity, just don't know how to create the menu.

Could anyone provide an example?

Thanks

E
Avatar of alfanhendro
alfanhendro

not sure whether it works on menu, but i used this for labels, list, etc.

Create the Menu as control array from the interface.
(one menu item is enough)
when you need to create a new one, just load it.
eg.
assuming the one created in the interface is has Index = 0

IndexCtr = IndexCtr + 1
Load mnuItem(IndexCtr)
mnuItem(IndexCtr).Visible = True
Avatar of Ryan Chong
Alternatively you can done this also by using APIs:

http://www.allapi.net/apilist/apifunction.php?apifunction=CreatePopupMenu
Avatar of escheider

ASKER

alfan:

So I have to create at least one entry using the Menu Editor in order to use code?  And the initial entry I create should initiate the control array?

So lets say i want to create a menu called Reports.  I create the Heading (Reports), then create the first entry under Reports?
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
exactly.
(point goes to ryancys if it helps)
Works like a champ.  I appreciate both of your help and have awarded ryancy's the points because alfanhendro said to do so.

Thanks

Escheider