Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP!!! . How Do I Create the Menu Control Arrays

Status
Not open for further replies.

eang

Technical User
Nov 20, 2000
3
PA
Menu control array elements must be contiguous and within the same submenu
 
Set the index property of the menu item (in the menu editor) to 0.
Use 'load' to add new items.

Example:
---------------------
Dim i As Byte

Private Sub Form_Load()
i = 0
End Sub

Private Sub mnuTest_Click(Index As Integer)
i = i + 1
Load mnuTest(i)
mnuTest(i).Visible = True
mnuTest(i).Caption = "Test" & CStr(i)
End Sub
---------------------- Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
>> Menu control array elements must be contiguous and within the same submenu

I am getting this too. I just need to create a menu control array during design-time.

I have tried playing with the Index of my control array incrementing each sub-menu item (0=parent, 1,2,3 ... sub-menu items). Still no luck. Must a Menu control array be "loaded" to work?


Thanks,

Michael42
 
FYI, I figured it out! :)

I needed to :
1. Make my parent menu a "standard" name (mnuReport).
2. Then make a array of sub menu items the control array: aReports(0), aReports(1)...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top