GGJJ,急求一个函数(简单),如何取得当前鼠标的位置。 GGJJ,急求一个函数(简单),如何取得当前鼠标的位置。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 设置二个全程变量xx,yy:integer;在procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);beginxx:=x;yy:=y;end; 下面的代码,Popup菜单并不在鼠标当前位置显示。Why?procedure TActiveFiveChess.suiButton1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);var xx,yy :integer;begin xx:=X;yy:=Y; suiPopupMenu1.FlatMenu:=true; suipopupmenu1.Popup(xx,yy);end; var p:Tpoint;begin GetCursorPos(p); //p.x:横坐标; p.y:纵坐标end; 因为你得到的坐标是相对于button来说的,而memu.popup是相对于屏幕来说的,可以这样: getcursorpos(p); popupmenu1.Popup(p.X,p.Y); procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);begin Form1.Caption:=IntToStr(x)+','+IntToStr(y);end; 怎样把字符串转化为 Utf8 编码,高手指点 oracle 中出现乱码的问题(贡献50分,在线等待中) 更新数据的问题 如何获取IE中的标题信息,并对可以对标题信息进行搜索!有思路就给分! delphi+SQLite结帖再问! 在多文档中,怎样判断子窗口已经打开,并把其关掉!!! 使用TWinXP控件出现的问题。 请问:f: file of Byte; 和 f: file; 有什么区别? 小妹?^_^?:捉虫:输入数据格式的问题? 哪里有Kylix可下载(要能解压和安装的) 如何在标准DLL中封装一个ActiveX对象或者VCL对象 关于Com调用的问题,高手请进!!!
在
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
xx:=x;
yy:=y;
end;
procedure TActiveFiveChess.suiButton1MouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
var
xx,yy :integer;
begin
xx:=X;yy:=Y;
suiPopupMenu1.FlatMenu:=true;
suipopupmenu1.Popup(xx,yy);
end;
p:Tpoint;
begin
GetCursorPos(p); //p.x:横坐标; p.y:纵坐标
end;
getcursorpos(p);
popupmenu1.Popup(p.X,p.Y);
Y: Integer);
begin
Form1.Caption:=IntToStr(x)+','+IntToStr(y);
end;