Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Event firing BEFORE form.load
Message
De
04/03/2009 06:38:21
 
 
À
04/03/2009 05:39:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01385412
Message ID:
01385422
Vues:
92
>I have a problem with events firing before my forms load event.
>
>If you create a pageframe class and add an _assign method to the .pagecount, add that pageframe to a form class with say 2 pages.
>If you now create a form based upon that form class and change the .pagecount to 3 or more then the pagecount_assign method of the pageframe class will fire before the forms load event!
>
>Why is this a problem? well the form in question has a private datasession, so when the pagecount_assign runs all the enviroment settings (SET TALK etc) are all set wrong.
>
>I have a temporary work around by setting the Environment settings in the BeforeOpenTables, but that means I have to code it in each form and can't put it in my class.
>
>Has anyone come across this? is there anyway around it?
>
>
>Gary.

Gary,

I've seen this happen. Maybe someone knows a better solution but here's how I got around

(1) Add a property to you form class 'Loading' and set it to .T.

(2) at the end of your form's class Load() or at the start of the Init() set it to .f.

(3) Test it
Pageframe.PageCount_Assign

if( m.thisform.Loading )
  && do nothing
endif
(4) you may need to add - at the end of the PageFrame's init()
this.PageCount = m.this.PageCount
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform