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?
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)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.