Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get global coordinates from local coordinates ?

Status
Not open for further replies.

vhad

Programmer
May 27, 2001
26
ID
I have a form opening another form with desktop property set to .T. with clicking a Button
I want to set the location of the Desktop Form displayed exactly under the Command Button.

I can get the Local coordinates of the location, but how to set the Desktop Form location which is using Global coordinates.

Can you help ?
Thanks in advance.
 
HI
Have you tried to add _screen.top value to the local coordinates. You may need to play a little depending on title bar associated position. I havent tested that way. :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Thanks,

I have tried using Foxpro API _WLeft and _WTop and it works.
Will try your suggestion. Maybe using API is too complicated.

Vincent
 
Ramani,

Yes, it works very good. But we have to consider the Border widths and TitleBar setting.
Is it true that the Border is 3 pixels wide and the TitleBar height is 20 pixels ?
I just using trial and error to get that figure.

Thanks.
 
Those numbers are actually based on the user's Windows control panel settings, but you can retrieve them by using the SYSMETRIC() function. Look in your help file for the various parameters...there are 34 of them. They will give you the sizes of things such as the total screen width and height, scroll box sizes, window title height, frame width/height...you will probably need to experiment a little to figure out exactly what each of those means, though.

Hope that helps,

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top