Is it possible to add menus at run-time?
I have a list of changeable options stored in a file, and I want to read that file and list them under a 'projects' menu.
If not it means I have to use a stupid ComboBox. :(
Printable View
Is it possible to add menus at run-time?
I have a list of changeable options stored in a file, and I want to read that file and list them under a 'projects' menu.
If not it means I have to use a stupid ComboBox. :(
You can load them like you normally load an Array. Here is an example. Make a Form with a menu and a SubMenu called mnuSub. Now make a CommandButton on the Form and place this code into it.
Code:Private Sub Command1_Click()
I = mnuSub.Count ' Get the empty Index
Load mnuSub(I) ' Load the Menu
mnuSub(I).Caption = "New Menu" ' Set it's Caption
End Sub
Use the menu editor, create all the things that you need, and what you don't need at start up, you could just set the property to visble = false