Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning a value from a shortcut menu
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Divers
Thread ID:
00549942
Message ID:
00549960
Vues:
16
>I mean if I have a shortcut menu and I want one of the options to return a .t. is something happened successfully, can I do that?

Nor really "return", but you declare the variable before calling the menu (or use an object property to store the result value) and check it after the menu call.
* mymenu1.mpr
DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
DEFINE BAR 1 OF shortcut PROMPT "Success"
DEFINE BAR 2 OF shortcut PROMPT "Bummer"
ON SELECTION BAR 1 OF shortcut myvariable = .t.
ON SELECTION BAR 2 OF shortcut myvariable =.f.

ACTIVATE POPUP shortcut
* Form.RightClick()
myvariable = .f.
do menu1.mpr
WAIT WINDOW IIF (!empty(myvariable),  "Success!", "Bummer...")
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform