Results 1 to 4 of 4

Thread: Top Level & Sub Level Menus at runtime

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    Masterton, New Zealand
    Posts
    20

    Top Level & Sub Level Menus at runtime

    Doe's any one know how to create menu Items at run-time.

    E.G I'd like to create a Friends Top Level Menu Item. Under that I want Bob as an Item, Fred as an Item, Taylor Family as an Item, but be able to Sub Level the Taylor Family so I can put in Tim and Jill in as a sub Level of Taylor Family.

    Any Ideas?

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    You can do so using indexed menus. Create one menu item and give it an index of zero, then use:

    VB Code:
    1. Private Sub Command1_Click()
    2.   Load mnuOpen(mnuOpen.UBound + 1)
    3.   With mnuOpen(mnuOpen.UBound)
    4.     .Caption = "Open #" & mnuOpen.UBound
    5.     .Visible = True
    6.   End With
    7. End Sub
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    If it doesn't HAVE to be a menu then I would use a treeview control. Otherwise you just indent or if you mean at run time then use different index patterns.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    Masterton, New Zealand
    Posts
    20
    The code seems to only add a TOP Level Menu Item, How do I do the indent for the sub levels??

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