Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form's problem
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00216559
Message ID:
00216561
Vues:
28
Nadya,

In your Main.Release() method you can iterate through the _screen.Form[] collection and call _screen.Form[i].Release() for all the other forms. You don't want to try to Release() the main form because you'll infinite loop.

>Hi, All!
>
> My problem is simple, but I spent a day trying to do something unsuccessfully :(
>
> My first form (called it "main") can invoke another form, which can invoke another form:
>
> main->chform1->chform2. I want to load these forms only once, and then just show - hide them.
>
> I don't want to load them in Init (Load) event of my main form since I'm not sure that these forms
>would be requested by user. So I tried this:
>
> IF _Screen.FormCount=1 && First call
> DO Form chform1 with par1
> ELSE
>
> Here I have my first problem: If I try to write something like this:
> chForm1.SHOW()
> I have an error message: "chForm1 is not an object". I named my Form as I named the .scx file,
> so it's not a problem. In the debugger I see, that on DO FORM new object is not created.
>
> Ok, I solved this problem:
>
> FOR i=1 to _Screen.FormCount
> if UPPER(_Screen.Forms(i).Name)="CHFORM1"
> _SCREEN.FORMS(i).SHOW()
> EXIT
> ENDIF
> ENDFOR
>
> But I still have problem with release event of my main form. I want to unload/release all these forms.
> So, where and what code do I have to write? I tried in Destroy method of my main form, but I think now
>that code should be in RELEASE method. Anyway, what code should it be?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform