RSS订阅 | 匿名投稿
您的位置:网站首页 > 鼠标 > 正文

delphi 获取窗体坐标触发事件

作者:admin 来源:未知 日期:2010/5/22 20:02:51 人气: 标签:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;

type
TForm1 = class(TForm)
Timer1: TTimer;
Edit1: TEdit;
Label1: TLabel;
Memo1: TMemo;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}


procedure TForm1.Timer1Timer(Sender: TObject);
var
pt: TPoint;
begin
GetCursorPos(pt);

pt := ScreenToClient(pt);

edit1.Text := Format('%d;%d', [pt.X,pt.Y]);
if Format('%d;%d', [pt.X,pt.Y])=Format('%d;%d', [90,66]) then
begin
showmessage('³É¹¦£¡');
end;

end;


end.

读完这篇文章后,您心情如何?
0
0
0
0
0
0
0
0
本文网址:
下一篇:delphi抓屏代码