Delphi如何在控件上获取光标位置? [英] Delphi How to get cursor position on a control?
本文介绍了Delphi如何在控件上获取光标位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道TCustomControl上光标的位置。
I want to know the position of the cursor on a TCustomControl.
推荐答案
您可以使用MouseMove事件:
You can use MouseMove event:
procedure TCustomControl.MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Label1.Caption := IntToStr(x) + ' ' + IntToStr(y);
end;
这篇关于Delphi如何在控件上获取光标位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文