Self.Edit1.Text := IntToStr(Mouse.CursorPos.X);
Self.Edit2.Text := IntToStr(Mouse.CursorPos.Y);
{
其中Mouse是TMouse对象,TMouse类在classes里面声明,Mouse对象的构造也在Classes里面,所以可以直接使用
}
procedure TForm1.FormClick(Sender: TObject);
begin
if Button1.Enabled=false then
begin
Edit1.Text:=inttostr(Mouse.CursorPos.X);
Edit2.Text:=inttostr(Mouse.CursorPos.Y);
Button1.Enabled:=true;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Button1.Enabled:=false;
end;
点击Button1开始取坐标
哈~~~明白了