Results 1 to 6 of 6

Thread: Menus

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    15

    Question

    Simple question......

    How do i add and remove menu items at run-time?

    thanks
    If practice makes perfect...

    and nobody's perfect...

    why the hell practice?

  2. #2
    Lively Member
    Join Date
    May 1999
    Location
    Singapore
    Posts
    116
    there is 1 way...
    set the visibility of the menu to true or false

    it is the easiest way...
    YC Sim
    Teenage Programmer
    UIN 37903254



  3. #3
    Guest
    To add items at menu time:

    Code:
    'Code from Megatron:
    
    Make a menu called mnuTest with a SubMenu called mnuSub.
    Make sure that that Index property for it is set to 0.
    Now insert this code into a CommandButton on the Form.
    
    Private Sub Command1_Click()
    
        ' Add's another menu
        Load mnuSub(mnuSub.Count)
    
    End Sub

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    15
    If i have a menu called mnuMain, can i add and remove items from that menu at run-time?
    If practice makes perfect...

    and nobody's perfect...

    why the hell practice?

  5. #5
    Guest
    Yes, but you must already have a SubMenu to add others. Make a SubMenu called mnuSub (Set the Index to 0) and put the following code into a CommandButton.

    Code:
    Private Sub Command1_Click()
    
        i = mnuSub.Count
        Load mnuSub(i)
        mnuSub(i).Caption = "New Menu"
    
    End Sub


  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    15

    thanks

    Thanks Megatron, im gettin there now.

    How would i remove menu items, and set the click properties for each new menu item etc etc?
    If practice makes perfect...

    and nobody's perfect...

    why the hell practice?

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