Link to home
Start Free TrialLog in
Avatar of mi5
mi5

asked on

Creating menu bar/items at runtime

Is it possible to create a standard menu bar at the top of the form at runtime and then add menu items to it? If not, is it possible to extend an existing menu bar, also at runtime?
ASKER CERTIFIED SOLUTION
Avatar of avitalk
avitalk
Flag of Israel 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
Avatar of mi5
mi5

ASKER

How do I set which son menu items go under which father items?
after you define any menu item you can define sons for it.
son items are define the same way as the father menu, they should be under the father menu in the menu definition window, and you should use the buttons with Left / Right arrows to indicate the
parenthood.

select the son menu item and press the button with the Right Arrow.  that will add 4 points to the son. and that indicates the hierarchy.

for more information try this link:
http://msdn.microsoft.com/library/devprods/vs6/vbasic/vb98/vbrgnmenueditor.htm
Avatar of mi5

ASKER

I meant at run time. It is possible to create father menu items at run time - how do I place son items underneath them?
I don't think you can do that.
you can add controls to an already existing control array but you can't define a totally new control.

may i ask - why is the solution of control array not good for you ?

Avital
Avatar of mi5

ASKER

No - they're all in the same control array. If I create new instances of the control array (the son menuItem), how do I move that menu item so it is a sub-menu of a father menuItem (also created from the same array)?
Avatar of mi5

ASKER

Adjusted points from 50 to 60
Avatar of mi5

ASKER

In fact - don't worry about it. I've found another way round the problem. Thanks for your help.
hmmm, I don't mind helping :-)

let's see if i understand you correctly, you have a father menu item, and the items you want to add during run time are his sons ?

if so then all you need to do is define one son item in design time.  give it an index = 0, and that's the start of the control array.

during run time when you load new menu items to that array, they are automatically, sons of the same father menu, because that's how menu arrays behave.  if you load more items to the array they all stay in the same level.
was that the issue ?