Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Define and Call one form from within another form?
Message
 
 
To
18/12/2002 10:04:47
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00734089
Message ID:
00734096
Views:
17
>Is there anyway to have a method of a form contain the code (from the class code of a form) to define a 2nd form so that the 2nd form can be instantiated from within the 1st form?
>
>Tracy

VFP methods do not allow the existence of additional PROCEDURES within the method. If you need to fully control the second form from the method, the second form needs to be modal...

local loForm
DO FORM MyForm NOSHOW NAME loForm
loForm.Closable = .F.
loForm.SHOW(1) && even for a non-modal form, this will switch it on the fly
*!* get form values here
loForm.Release()

You will want to HIDE() the form instead of release it in the form's Exit button. You also need to disable the form close button to prevent releasing. Once the form HIDE() fires, control returns to the line in the method after loForm.SHOW(1). Then you can get whatever info from the form objects next.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform