Solved

How to Add Multiple Menus

Posted on 2008-10-20
1
154 Views
Last Modified: 2010-04-30
All im trying to do is creating multiple menus like we create multiple forms with 1 form so the same thing how to do with menus
0
Comment
Question by:BILAL69
1 Comment
 
LVL 7

Accepted Solution

by:
FER_G earned 500 total points
ID: 22760478
Adding menus at runtime is handled in the exact same way as adding any control at runtime.
First you have to create a control array at design time, then at runtime you just load the new controls into the array. Steps...
# Open Menu Editor&
# In the editor add a main menu, add a submenu (mnuAddM).
# Set its index property to 0. By setting its index property, you tell VB that you want this menu to be the first element in the control array.

At runtime, you just do...
Private Sub Form_Load()
      mnuAddM(0).caption = "Added 1"
      Load mnuAddM(1)
      Load mnuAddM(2)
      mnuAddM(1).Caption = "Added 2"
      mnuAddM(2).Caption = "Added 3"
End Sub

.....

FerG
Saludos
--
Ing. Fernando D. Giletta
San Fco. Cba. Argentina.

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now