Link to home
Start Free TrialLog in
Avatar of TGB
TGB

asked on

'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.
Avatar of caraf_g
caraf_g

Not with VB menus. Sheridan sells a menu control that allows you to do this sort of stuff.
Avatar of TGB

ASKER

Please tell me more about this Sheridan  product. Many Thanks.
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.
sorry!
I think I have misunderstood the question.

alok.
ASKER CERTIFIED SOLUTION
Avatar of Vbmaster
Vbmaster

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
a $200 control with no source code versus free source code.. tough choice
True <g>
Hey, vbmaster, is the code for the subtimer dll also free?
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
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.
u?
r?
What language are you speaking?