开发者

How can I get cursor position on the form?

开发者 https://www.devze.com 2023-02-27 11:12 出处:网络
I开发者_运维问答 need to get cursor position on the form, how would I do that?Pass Mouse.CursorPos to TForm.ScreenToClient().

I开发者_运维问答 need to get cursor position on the form, how would I do that?


Pass Mouse.CursorPos to TForm.ScreenToClient().

Mouse.CursorPos is returned in the screen coordinate system. TForm.ScreenToClient() converts points into the form's client coordinate system.

In fact all TControl descendants offer the ScreenToClient() method, and its inverse, ClientToScreen(), to convert between coordinate systems.

0

精彩评论

暂无评论...
验证码 换一张
取 消