Team DEVConvert local position to global

17 May 2009, 03:19

Is there a function in delphi which will convert a local position on a component (on a form) to the global position of this position on the form...

If I want to be more precise: Go check Here :)
That is a function for actionscript3 which does what I want. But I was wondering if there was something similar in delphi.

Gosh I hope I made myself clear... -_-

Rating 1 Comments 5
Deleted comment
JM-DG
1
JM-DG 17 May 2009, 14:15 #
Sorry check here then ^^
This is the good link
master_lame_master
0
master_lame_master 18 May 2009, 10:29 #
maaaan,.. i did something like that... but.. i forgot how :( ... i'll try to find something out :)
master_lame_master
1
master_lame_master 18 May 2009, 10:33 #
OK... the function is ScreentToClient() and (backward) ClientToScreen...
this peace of code i've found on the net
var
pt : tPoint;
begin
pt := Mouse.CursorPos;
// now have SCREEN position
Label1.Caption := 'X = '+IntToStr(pt.x)+', Y = '+IntToStr(pt.y);
pt := ScreenToClient(pt);
// now have FORM position
Label2.Caption := 'X = '+IntToStr(pt.x)+', Y = '+IntToStr(pt.y);
end;
JM-DG
0
JM-DG 18 May 2009, 14:26 #
Ho yeah that's right.
Thank you! I forgot completely about this :)
+ 1 ^^
Reply

You have to login or register to post comments.

JM-DG
JM-DG
92 ♠ 227 ♣
Tweet:


Bookmark and Share