Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ActivePage...Not!
Message
 
 
À
04/05/2001 13:51:43
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00503661
Message ID:
00503851
Vues:
30
>The following code works fine except that ActivePage does not get reset to nLastPage. I have traced it as well as put a textbox on the destination page and even though the focus is on the correct page, and I can move around on the page, the ActivePage is staying at the original value. For example, assuming nLastPage=3 and cLastPage="Page3", when I'm on Page4 of a pageframe and click a button (Valid code is below) Page3 appears and is available, but the BackColor doesn't change (in Refresh of the pageframe I use ActivePage to do this) and the ActivePage is still equal to 4. I understand why the correct page is getting the focus as I'm calling it based on cLastPage, but why doesn't ActivePage get reset to 3? During a trace immediately after setting the ActivePage to 3 its value is still 4. Even if I hardcode the "3" instead of using nLastPage! Any ideas? Regards, Renoir
>
>With ThisForm
> .closable=.f.
> .cformmode=' '
> .T48_page_frame1.activepage = nLastPage
> .T48_page_frame1.&cLastPage..setfocus
> .T48_page_frame1.&cLastPage..Refresh
>Endwith


First of all, don't put this code in Valid, put it in Click event of the button.

Secondly, instead of setting ActivePage, try .T48_page_frame1.Page4.activate().
You also don't need to call page activate and page setfocus() methods. In each page Activate method put this code: this.Activate (e.g. each time page is activated, it's refreshed).

Finally, I have a habit to avoid macros, if it's not necessary. In this particular case you can use:
loPage=evaluate("thisform.t48_page_frame1."+m.cLastPage)
loPage.Activate()
etc.

HTH
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform