Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to click button
Message
De
22/11/2005 11:22:17
 
 
À
22/11/2005 11:01:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Network:
Novell 4.x
Database:
Visual FoxPro
Divers
Thread ID:
01071180
Message ID:
01071188
Vues:
15
How to click a button lying on a form thru a short cut menu. On doing so, I face an error "THIS can only be used within a method."

The actual command is 'This.parent.cmdSales.Click'


A menu isn't a child of anything, and what's more, isn't an object, so THIS.Parent is never going to work in a menu procedure.

A menu hit is more like an ON KEY interrupt, you can only address things that are in scope. So you must obtain a reference to your form through some other mechanism. Many people use _screen.ActiveForm or similar, i.e. the command in your menu procedure would be

_screen.ActiveForm.cmdSales.Click()

I'm not saying this would work for you; I'm saying you need to find another way to address your form.

I hope this helps,
- Colin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform