Creating a Menu Control Array

See AlsoPKFWTJ

A menu control array is made up of one or more menu items that share a common name and event procedures.  Each menu item has a unique index number, but all the items share the same setting of the Name2016V9P property.  You can designate one or more contiguous menu items at the same menu level as a control array.  This enables you to dynamically add or remove menu items during run timeCYRM35.

To create a menu control array with one menu item

   1. Create1DSHCUG the menu item.

   2. In the Index text box, enter a number.

 

To create a menu control array with more than one menu item

   1. Create a menu item.

   2. In the Index text box, enter a number.  This number determines the menu item's position in the control array.

   3. Create another menu item with the same control name.

   4. In the Index text box, enter a unique number.

   5. Repeat steps 2-4 for each additional menu item.

 

Note   When a control in the array recognizes an event, Visual Basic calls an event procedure for the group and passes the index as an additional argument, allowing you to determine which control recognizes the event.

 


See Also

Help:

Adding and Deleting Controls at Run Time10KLMP2

Attaching an Event Procedure to a Form or Control2LBGK4C

 

Programmer's Guide:

Chapter 4, "Menus and Dialogs"