Results 1 to 2 of 2

Thread: Creating new menus at runtime from listbox

  1. #1

    Thread Starter
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Creating new menus at runtime from listbox

    Hi all,

    I was wondering if it is possible to create new multiple menus as a listbox changes in content?

  2. #2
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Creating new menus at runtime from listbox

    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:
    1. Dim oldMnunum As Long
    2.  
    3. Private Sub ChangeMenus()
    4. On Error Resume Next
    5. For x = 1 To oldMnunum
    6.     Mnuitems(x).Visible = False
    7. Next
    8.  
    9.  
    10. oldMnunum = 0
    11. For x = 0 To List1.ListCount - 1
    12.     Load Mnuitems(x)
    13.         Mnuitems(x).Caption = List1.List(x)
    14.         Mnuitems(x).Visible = True
    15.         oldMnunum = oldMnunum + 1
    16. Next
    17.  
    18. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width