Hi all,
I was wondering if it is possible to create new multiple menus as a listbox changes in content?
Printable View
Hi all,
I was wondering if it is possible to create new multiple menus as a listbox changes in content?
This won't exactly create menus then destroy them when it changes. All it does is it create menu items makes visible the ones you need. To try this you will need One menu with a submenu - 'Mnuitems' with an index of 0.
VB Code:
Dim oldMnunum As Long Private Sub ChangeMenus() On Error Resume Next For x = 1 To oldMnunum Mnuitems(x).Visible = False Next oldMnunum = 0 For x = 0 To List1.ListCount - 1 Load Mnuitems(x) Mnuitems(x).Caption = List1.List(x) Mnuitems(x).Visible = True oldMnunum = oldMnunum + 1 Next End Sub