Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling a method contained in another Form
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00959744
Message ID:
00960199
Views:
8
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform