Results 1 to 2 of 2

Thread: Creating a Window List for menu

  1. #1
    Guest

    Question

    In an MDI form you can have several windows open.
    Often, there is a menu option "Window" and if it is selected a list of open documents is displayed with a checkmark next to the active document.

    Like in Word... you have

    Window
    New Window
    Arrange All
    Split
    ----separator
    Here is a list of open documents.

    How is this list created?
    I was thinking you can't add menu items dynamically.

    Thanks!

  2. #2
    Guest
    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()
    
        Load mnuSub(mnuSub.Count)   ' Loads another menu
        MyInt = mnuSub.Count - 1    ' Get the Index for the menu
        mnuSub(MyInt).Caption = Text1.Text ' Set the caption to whatever is in the TextBox.
    
    End Sub
    That should get you started.

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