Add menu items at runtime! :)

By | 2002-06-01

This code adds allows you to add menu item’s on your form while you are running it(runtime :)…

Original Author: Erik Tyldum

Assumptions

‘Goto the menu Editor!
‘Add a menu, and a submenu.
‘Name the submenu: ‘mnuTest’ and set its index property to ‘0’ <- Important!
‘Then you click OK!:)
‘Add a Command Button, named Command1… and paste my code into it, and

Code

Private Sub Command1_Click()
    Load mnuTest(mnuTest.Count)
End Sub

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.