Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine top and left of active row in grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01552416
Message ID:
01552427
Vues:
55
>>How can I determine the top and left, relative to the form, of the active row of a grid on a form?
>
>
>I think you'll need a bit of a calculation
>
>You may need to add a few pixels her and there - but this is what I think
>
>
>(1) if the grid does not have the focus, get the object with the focus, and set the focus to the grid
>
>(2) get the grid.ActiveRow
>
>(3) Restore the focus of the object that had the focus, if necessary
>
>(4)
>Get the grid's top and left with objtoClient()
>
>(5) calculate the offset of the activerow from the grid's top
>
>if( activerow ==  0 )
>  grid with no data
>else
>     TopOffset = HeaderHeight + GridLineWidth + (activerow -1) * ( RowHeight + GridLineWidth ?)
>
>     if( TopOffset  + iif( inlist(ScrollBars, 1, 3), sysmetric(SYSMETRIC_HSCROLLBARHEIGHT), 0) > grid.Height )
>        the active row is not visible
>
>     else
>        activerowTop = grid's top (from objtoClient() ) + TopOffset  
>     endif
>endif
>
>
Thanks, I ended up using ObjToClient() .
Brandon Harker
Sebae Data Solutions
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform