Simple question......
How do i add and remove menu items at run-time?
thanks
Printable View
Simple question......
How do i add and remove menu items at run-time?
thanks
there is 1 way...
set the visibility of the menu to true or false
it is the easiest way...
To add items at menu time:
Code:'Code from Megatron:
Make a menu called mnuTest with a SubMenu called mnuSub.
Make sure that that Index property for it is set to 0.
Now insert this code into a CommandButton on the Form.
Private Sub Command1_Click()
' Add's another menu
Load mnuSub(mnuSub.Count)
End Sub
If i have a menu called mnuMain, can i add and remove items from that menu at run-time?
Yes, but you must already have a SubMenu to add others. Make a SubMenu called mnuSub (Set the Index to 0) and put the following code into a CommandButton.
Code:Private Sub Command1_Click()
i = mnuSub.Count
Load mnuSub(i)
mnuSub(i).Caption = "New Menu"
End Sub
Thanks Megatron, im gettin there now.
How would i remove menu items, and set the click properties for each new menu item etc etc?