Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning from object
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00197174
Message ID:
00197221
Views:
15
Hi Ed,

>>What is the suggested method for returning a value from a formclass created programatically. I'd like to create a modal form and capture some value after a keypress.

Another technique you could use is to not release the form when the user clicks Cancel but Hide() it instead. That way everything about the form (user-defined props, control props, etc) are availble while it's hidden.

loForm = CREATEOBJECT("SomeFormClass")
loForm.SHOW(1) && SHOW(1) displays a form as a Modal form
***** Form is up and displayed for the user now...they click Close and you have
***** THISFORM.Hide() behind the Close button

At this point, everything about that form is still available since it hasn't been released, just hidden. Say there is a iKey user-defined prop on the form that gets set when the enter some value. Using

x = loForm.iKey

will return that value.

Say you need the value the user typed in the txtLastName control. Using

lcLastName = loForm.txtLastName.Value

would return it.

To really get rid of the form don't forget to do a

loForm.RELEASE()

and it's gone.

Hope this helps....
Jim Duffy
Microsoft MVP
INETA Speaker
TakeNote Technologies
Developer's Choice Award Winner for Best Training Company
Specializing in VB.NET, ASP.NET, VFP, and SQL Server Training and Development
Previous
Reply
Map
View

Click here to load this message in the networking platform