delphi'控件的相对坐标与屏幕坐标转换


本文整理自网络,侵删。

 
DELPHI 控件的相对坐标与屏幕坐标转换

一、直接上代码

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);
 

相关阅读 >>

Delphi 窗体的位置和高宽度-tform:letf、top、width、height、clientwidth、clientheight

Delphi 读写文本文件

Delphi 判断进程名是否存在,如果存在则结束进程

Delphi关于tjpegimage的使用(bmp\ jpg格式转换)

汇编基础寄存器

Delphi判断按下的是回车键?

Delphi 判断iso文件,iso文件头, iso filehead

Delphi 关闭xp保护 替换explorer.exe

Delphi xe android的所有权限按照分类总结说明

Delphi 自定义产生随机字符串函数

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...