'Dynamic' menus in VB6.0

Under VB6.0, is it possible to define the contents of a menu, other than by using the menu editor? Is it possible to load the contents of a menu, while the program is running, from a file? This way the menu can be changed by changing the file contents, and not by having to change the program each time.
TGBAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
VbmasterConnect With a Mentor Commented:
Sure it's possible, here's a excellent solution to do it, with a great example project, all free code of course. ,)

http://vbaccelerator.com/codelib/cpopmenu/article.htm
0
 
caraf_gCommented:
Not with VB menus. Sheridan sells a menu control that allows you to do this sort of stuff.
0
 
TGBAuthor Commented:
Please tell me more about this Sheridan  product. Many Thanks.
0
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.

 
alokanantCommented:
Yes it is possible.

You have to create a menu item, give an index to it say 0. In order to load other menu items and change different menu properties, u can use the following code -

dim mnu as menu.

' if the name of the menu item created on form is mnuTest and its index is 0.
then in the form load event u can write the following code -

load mnuTest(1)
mnuTest(0).Caption = "MyCaption1"
mnuTest(1).Caption = "MyCaption2"

'Similarly u can access other properties.

hth
alok.
0
 
alokanantCommented:
sorry!
I think I have misunderstood the question.

alok.
0
 
caraf_gCommented:
0
 
VbmasterCommented:
a $200 control with no source code versus free source code.. tough choice
0
 
caraf_gCommented:
True <g>
0
 
caraf_gCommented:
Hey, vbmaster, is the code for the subtimer dll also free?
0
 
VbmasterCommented:
Sure thing, you can find it on the page..

   http://vbaccelerator.com/codelib/ssubtmr/ssubtmr.htm

The direct link to the project code for the dll is

   http://vbaccelerator.com/codelib/ssubtmr/sbtmrc.zip
0
 
jayaram_tCommented:
It is possible to do it if u have at least one menu item in the menu excluding those that u r going to build up at run time from the text file. U must first create a menu item using the menu editor and give it an index of zero in order to specify that it is going to be part of a control array. Then u can use ur code to load menu items one by one and use the text from the text file as the menu captions.
0
 
caraf_gCommented:
u?
r?
What language are you speaking?
0
All Courses

From novice to tech pro — start learning today.