Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I determine the x,y coordinates of an object?
Message
From
27/01/2009 09:17:33
 
 
To
25/01/2009 22:37:37
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01376952
Message ID:
01377309
Views:
19
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
Previous
Reply
Map
View

Click here to load this message in the networking platform