怎么实现用鼠标左键点击Speedbutton出现PopupMenu(注意我要左键不要右键) 怎么实现用鼠标左键点击Speedbutton出现PopupMenu(注意我要左键不要右键) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TForm1.SpeedButton1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin PopupMenu1.Popup(100,100);end; procedure TForm1.SpeedButton1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);var pt: TPoint;begin if Button = mbLeft then begin GetCursorPos(pt); PopupMenu1.Popup(pt.X, pt.Y); end;end; 这很简单,算准按钮的座标位置,然后调用popupMenu1.Popup(X,Y); 在Speedbutton的onclick事件中写入:speedbutton1.PopupMenu:=PopupMenu1;speedbutton1.PopupMenu.Popup(鼠标位置x,y); 即:procedure TForm1.SpeedButton1Click(Sender: TObject);var pt: TPoint;beginspeedbutton1.PopupMenu:=PopupMenu1;GetCursorPos(pt);speedbutton1.PopupMenu.Popup(pt.x,pt.y);end; 还有一人不用API的procedure TForm1.SpeedButton1Click(Sender: TObject);var point:TPoint;begin point.X:=mouse.CursorPos.X; point.Y:=mouse.CursorPos.Y; ScreenToClient(point); PopupMenu1.Popup(point.X,point.y);end; Delphi 调用C++的dll问题 求购:Delphi 5.X分布式多层应用系统篇/电子商务篇 query参数传递 谁做过食堂送饭的系统!!了解一下!! 在Delphi中哪个函数可以把一个字符串反过吗? 急,关于quickrep折行的问题 请问dbf的数据文件用delphi怎么打开 MEMO和RICHEDIT中能画图片吗? 新来,问一个csdn的使用问题 50分求解三道简单的概率问题,急。(不是很难,计算机专业应该都知道) 请问以下窗体事件中,都是在哪些情况下才会动作? 毕业设计,课题是做一个MIS系统是用vfp还是用delphi或pb
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PopupMenu1.Popup(100,100);
end;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var pt: TPoint;
begin
if Button = mbLeft then begin
GetCursorPos(pt);
PopupMenu1.Popup(pt.X, pt.Y);
end;
end;
speedbutton1.PopupMenu:=PopupMenu1;
speedbutton1.PopupMenu.Popup(鼠标位置x,y);
procedure TForm1.SpeedButton1Click(Sender: TObject);
var pt: TPoint;
begin
speedbutton1.PopupMenu:=PopupMenu1;
GetCursorPos(pt);
speedbutton1.PopupMenu.Popup(pt.x,pt.y);
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
point:TPoint;
begin
point.X:=mouse.CursorPos.X;
point.Y:=mouse.CursorPos.Y;
ScreenToClient(point);
PopupMenu1.Popup(point.X,point.y);
end;