• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

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
0
escheider
Asked:
escheider
  • 2
  • 2
  • 2
1 Solution
 
alfanhendroCommented:
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
0
 
Ryan ChongCommented:
Alternatively you can done this also by using APIs:

http://www.allapi.net/apilist/apifunction.php?apifunction=CreatePopupMenu
0
 
escheiderAuthor Commented:
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?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Ryan ChongCommented:
Yes, you should use the Menu Editor to at least at an initiate control array menu.

First, create a Menu Parent for the control array menu, let say mMenu. Then under this mMenu, add an initiate control array menu by naming it as mReports, set its Index Property to 0 to indicate it's a member of Reports.

Then populate the mReports as get the elements from database. And at last, popup the menu to show the mReports by using PopupMenu mMenu.

cheers
0
 
alfanhendroCommented:
exactly.
(point goes to ryancys if it helps)
0
 
escheiderAuthor Commented:
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
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now