RE: How to create a right-click popup menu in VFP? by Allan
Allan
Sat Sep 29 21:43:00 PDT 2007
hi zoom,
say you want to add a short-cut menu on the grid's right-click method:
DEFINE POPUP GridPopup ;
FROM MROW(), MCOL() ;
MARGIN ;
SHORTCUT
DEFINE BAR 1 OF GridPopup PROMPT "Add Item"
DEFINE BAR 2 OF GridPopup PROMPT "Edit Item"
DEFINE BAR 3 OF GridPopup PROMPT "Delete Item"
ON SELECTION POPUP GridPopup _screen.activeform.GridPop(BAR())
ACTIVATE POPUP GridPopup
RELEASE POPUP GridPopup
*-- the _screen.activeform.GridPop is a custom method i have in my form
class with the following code:
LPARAMETERS tnBar
DO CASE
CASE tnBar = 1
*-- thisform.GridAddItem()
CASE tnBar = 2
*-- thisform.GridEditItem()
CASE tnBar = 3
*-- thisform.GridRemoveItem()
ENDCASE
DEACTIVATE POPUP GridPopup
hope this would help...
allan
"Zoom" wrote:
> Hi,
>
> I am trying to create a right-click popupmenu in VFP similar to when you
> right-click in windows and get a menu. I want to have the menu with
> pre-defined user options and be able to determine which option the user
> clicked on. Is there any way to do this in VFP9?
>
> Thanks
>
> Zoom
>
>
>
>