Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Created Form Class from Form Class
Message
From
16/05/2003 11:28:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00789231
Message ID:
00789264
Views:
21
>Defining the FORM object within the routine that uses it, releases it when that routine finishes it. I want to keep this form until 'I' release it.
>
>Out of scope problem in routine that uses the form - I get error "MyForm1" not an object
>
>      &frmMyForm..Caption= thisform.tprest+ "="+ lcRemotePath
>
>where could I place this code to define "MyForm1" thru "MyForm9" to be maintained for the life of the session.
>
>    FOR nVarWin= 1 TO 9  && Create View Windows
>        frmMyForm= "MyForm"+ALLTRIM(STR(nVarWin))
>        &frmMyForm= CREATEOBJECT("Form")
>        &frmMyForm..Width= 550
>        &frmMyForm..Show
>    ENDFOR
>
>Then I will want to control when to release the forms from a button on the main form class.
>
>* Tform *
>DEFINE CLASS Tform As Form
> Width= 375
> Height=290
>...

Add an array property to main form or to oApp custom application, ie: arrForms.
dimension frmMain.arrForms[9]
FOR nVarWin= 1 TO 9  && Create View Windows
   frmMain.arrForms[nVarMin] = CREATEOBJECT("Form")
   with frmMain.arrForms[nVarMin]
       .Width= 550
       .Show
   endwith
ENDFOR
For a better sample check solution.app for multiple instance forms.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform