by Pete Cozens (3 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating:
(4 Votes)
This control, when placed on a form, will allow you to dynamically create menus at runtime. I have included the code for the OCX and a simple test harness.
Inputs
N/A
Assumes
This code was developed in VB6 on NT4.
It requires that you add a dummy popup menu with a child menu array item to the form to work (Neither of which will be visible at runtime). Take a look at the View menu in the test harness to see how the dummy menu items should be setup.
Update: You'll also need to have atleast one other VB menu item at the same level as the 'dummy' popup menu, otherwise VB will not allow the dummy to be hidden.
Code Returns
N/A
Side Effects
None known at this time.