Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling a method contained in another Form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00959744
Message ID:
00960199
Vues:
9
Barne, Borislav is mistaken on this one. Forms can certainly call each others methods. The only caveate to this is that the form whose method you want to call has to be running or instantiated.

Try this:
Create Form1, add a method called 'tester' and put this code int the method:

Messagebox('this is a test, form1')

Make sure in the property sheet you name this form1.

Create form2, add a command button. In the Click event of the command button add this code:

IF VARTYPE(form1) = 'O' && checks for a valid object reference
Form1.Tester()
ENDIF

Now run both forms at the same time, and click the command button on form 2.

You will see the messagebox for form1.tester event. You just called one forms events from another.
Woodie Westbrook
I came, I saw, I compiled.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform