Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Click on PageFrame Set Focus to specific control
Message
De
28/04/2004 12:43:04
Andrew Fell-Gordon
Calypso Publications Ltd
Enfield, Royaume Uni
 
 
À
28/04/2004 09:25:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00897736
Message ID:
00899020
Vues:
22
This message has been marked as a message which has helped to the initial question of the thread.
>
>...It doesn't escape me though that all of this could be avoided if a page tab had its own properties from the page itself. Somehow I think a page 'tab' should be a property of the page. Hey, I could even set the backcolor of the page tab to be different than the page itself and other tabs if I wanted to and have colored page tabs! :o)
>

I simulate this in one of my systems by having code that looks like this in my form's init
Local lnX,lnY,oFirst,olast,lnMaxTabIndex
With this
  Dimension .pagetabs(.pageframe1.PageCount,2)
  For lnX = 1 to .pageframe1.PageCount 
     oFirst = Null
     oLast = Null
     lnMinTabIndex = 10000
     lnMaxTabIndex = 0
     With .PageFrame1
       For lnY = 1 To .Pages(lnX).ControlCount
         With .pages(lnX)
           If PemStatus(.Controls(lnY),"TabStop",5)
             *-- This is a tabable control
             If .Controls(lnY).Tabindex < lnMinTabIndex
               *-- this could be the first control
               lnMinTabIndex = .Controls(lnY).Tabindex
               oFirst = .Controls(lnY)
             Endif
             If .Controls(lnY).Tabindex > lnMaxTabIndex
               *-- this could be the last control
               lnMaxTabIndex = .Controls(lnY).Tabindex
               oLast = .Controls(lnY)
             EndIf
          EndIf
        endwith
      Next
    EndWith
    *-- store the first and last tabbable controls
    *-- in the array
    .pagetabs(lnX,1) = oFirst
    .pagetabs(lnX,2) = oLast
  Next
  .currentpage = -1
EndWith
This gives me an array of the first and last tabable controls on each page.
Once I know which page I'm on and which direction I'm going I know which control to manipulate fron the position in the array. You could use it to colour your controls

Also means that I don't have to change any code if I change the tab order of the controls or add a new page.

Best regards

Andrew
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform