DELPHI 控件的相对坐标与屏幕坐标转换
程序员文章站
2022-05-01 12:33:53
...
一、直接上代码
var
pt: TPoint;
r: TRect;
begin
pt := Point(Edit1.Top, Edit1.Left);
pt := ClientToScreen(pt);
Edit2.Text := inttostr(pt.X);
Edit3.Text := inttostr(pt.y);
Mouse.CursorPos := Point(pt.X, pt.y);
GetWindowRect(Form2.Handle, r);
Mouse.CursorPos := Point(r.Left + 20, r.Top + 150 + 20);
上一篇: js获取距离屏幕的坐标