vb6dynamiccreationsubmenu

Dynamic two or more levels sub-menu generation in vb6


Friends, Tell me how to generate more than 1 levels of sub-menu in VB6 at runtime? Explain in brief? Any specific controls are there? But i dont want to use external controls!


Solution

  • You can do this with standard VB-menus, but since you'll have to use control arrays, you have to create a first prototype menu with Index = 0 (e.g. mnuFoo(0)) at design time (usually invisible). You can now load new items dynamically.

    Call Me.Load(mnuFoo(1)) ' New array member (index 1) '
    With mnuFoo(1)
        .Visible = True ' Make it visible
        ' --- Do some settings
    End With