Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a popupmenu by selecting an option from another popup menu

Status
Not open for further replies.

VentureNewBie

Programmer
Jul 17, 2001
4
IN
Hi...
I have a form which gives a popupmenu to choose from.. this opens a form and the called form also has a popup menu to be shown.
The popupmenu in the called form doesnot open when it is done by selecting the option from the popupmenu.
The same works when I click on the button on the form which will call the other form containing the popupmenu.

Can anyone please suggest.

Rgds,
VentureNewBie
 
You can't call a popup while another popup is active somewhere in your function call chain. You need to save the popup item the user selected in a variable, and then when execution returns to your right-mouse click event, do a select-case on that to call the function they wanted.
Code:
On_RightMouseClick event
   sChosen = ""
   'show mnuPopup here

   select case sChosen
   case "Fold":
      DoFold()
   case "Spindle":
      DoSpindle()
   case "Mutilate":
      DoMutilate()
   End Select
End Event

mnuPopupFold event
   sChosen = "Fold"
End Event

mnuPopupSpindle event
   sChosen = "Spindle"
End Event

mnuPopupMutilate event
   sChosen = "Mutilate"
End Event

Hope this gets you started, and hope this also points out that it's a bad idea to put code in the GUI event routines. ;-)

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top