|
-
Apr 27th, 2000, 12:43 AM
#6
Addicted Member
Sorry, little mistake, you can also load top-level entries as well, I just did a little test. The only problem is that every top-level entries does not (for obvious reasons) contain the same sub-menus as the first index. Oh yeah, if you were wondering how to do it:
First, when you create your menu items, you must set the index of the menu that you want created multiples of to zero or some arbitary number, just as long as it knows it is in a control array.
Now to add a menu item (we'll call the control array Menu item mnuTest) do the following:
Code:
Private Sub AddMenuItemTest(sCaption As String)
Dim iNextIndex As Integer
iNextIndex = mnuTest(mnuTest.UBound).Index + 1
Call Load(mnuTest(iNextIndex))
mnuTest(iNextIndex).Caption = sCaption
End Sub
Call this as many times as you want to add items. You may also want to extend this function to allow other properties of the new menu item to be passed, such as Enabled and Checked.
Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|