Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I determine the x,y coordinates of an object?
Message
 
 
À
25/01/2009 22:37:37
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:
01376952
Message ID:
01377309
Vues:
24
Jay,

Try this.Just pass it an object reference to the control you want to target. It doesn't need any API calls. You might want to adjust where the moure is moved to. I centered it in the control...

Hope this helps!

Steve

LPARAMETERS oControl

m.iTop = OBJTOCLIENT(oControl, 1)
m.iLeft = OBJTOCLIENT(oControl, 2)

m.iTopBorder = Sysmetric(4)
m.iLeftBorder = Sysmetric(4)
m.iTitleHeight = SYSMETRIC(9)

m.iTitleBarHeight = m.iTitleHeight + m.iTopBorder

m.iY = m.iTop + m.iTitleBarHeight + ThisForm.Top m.iX = m.iLeft + m.iLeftBorder + ThisForm.Left

MOUSE AT ;
m.iY + ROUND(oControl.Height/2,0), ;
m.iX + ROUND(oControl.Width/2,0) ;
PIXELS
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform