Results 1 to 3 of 3

Thread: Dynamic Menus

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Posts
    116

    Question

    HI

    how can I create Dynamic menus and then know which
    option the user choses ?
    10x,
    Amos

  2. #2
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    Using the API and then SubClassing the menu's. I don't have code, but maybe someone will post some, otherwise i will try to dig some up!
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  3. #3
    New Member
    Join Date
    Feb 2001
    Location
    Portugal
    Posts
    8
    You may start by creating one indexed menuitem with the index 0

    next you will create new indexes of that first menuitem.

    when the user selects one menuitem there will be a call to

    Private Sub menusubitem_Click(Index As Integer)

    there you already know the index and can know about the name of the menus...

    Example:

    create a form with one menu called menuitem
    create item inside that menu called menusubitem

    insert this code:
    ________________________

    Private Sub Form_Load()
    For i = 0 To 6
    If i > 0 Then Load MenuSubItem(i) 'this will create a ney item with index i
    MenuSubItem(i).Caption = "Item &" & i ' change the caption of the new item
    Next i
    End Sub

    Private Sub MenuSubItem_Click(Index As Integer)
    MsgBox ("you have clicked on menuitem " & Index)
    End Sub

    ____________________

    I hope this was what you were looking for.

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