Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I call a Method from outside the Form
Message
De
13/03/2005 22:22:57
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
13/03/2005 22:00:39
Freddie Rodrigues
Bitrun Business Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00995365
Message ID:
00995367
Vues:
21
>The Form name is uditempl. From within the Form I have no problems. I need to call this Method, from either a Class or a program file if possible.
>
>Thisform.pageframe1.page1.itemsgrid.setfocus()
>
>Thanks

First, you need to have an object reference to the form. This is best done when you instantiate (open) the form. For example, if your form is saved as a class:
local loForm
loForm = CreateObject("cClient")
Or, if the form is saved as a form:
local loForm
do form FrmClient name loForm
Now, from outside the form, you can use loForm (or whatever you call it - it is your variable) just as you would use ThisForm from within the form. For instance, your example becomes:
loForm.pageframe1.page1.itemsgrid.setfocus()
or you can call a form method:
loForm.RecalculateTotals() && assuming you created this method
Saludos,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform