HI
how can I create Dynamic menus and then know which
option the user choses ?
Printable View
HI
how can I create Dynamic menus and then know which
option the user choses ?
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!
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.