Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Activate a page by name
Message
De
10/03/2008 18:26:38
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
10/03/2008 17:11:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01300686
Message ID:
01300728
Vues:
8
>It's much too late in the week for me to be thinking coherently.
>
>I have a PageFrame control. Instead of setting the active page via a number, I would like to set it by referring to the page name. For example
>thisform.pFrame.ActivePage = "pagename"
>
>I can think of a couple of ways do doing this with form properties but I'm hoping there is something within the pageframe control that I can reference directly.

If you subclass the pageframe, in the subclass you may try to add an assign method to the ActivePage property, and there
*-- 
lparameter vNewVal
if vartype(vNEwVal)="C"
   for i=1 to this.pagecount
      if upper(this.pages[i].name)=upper(vNewVal)
         vNewVal=i
         exit
      endif
   endfor
endif
this.activepage=vNewVal
Looking at what Çetin proposed, here's a better one:
if vartype(vNEwVal)="C"
   oPage=this.getpem(vNewVal)
   vNewVal=oPage.pageorder
endif
this.activepage=vNewVal
Error checking etc left as an exercise ;).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform