B blackbutterfly Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-17 #1 这样点击鼠标左键,激发popupmenu? 坐标怎样控制才有效呢? 使popupmenu出现在点击右键出现的位置呢?
磊 磊 Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-17 #2 在onMouseDown事件中 if (button=mbright) then begin ... x:=aa.clienttoscreen().x; ... end;
P pldu Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-17 #3 用popupmenu1.Popup(x,y:integer)可以指定popupmenu的位置,在要激发popupmenu的事件中 写这个过程就行了。
B blackbutterfly Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-17 #4 to 磊:能不能具体点:)谢谢:) to pldu:我问的就是鼠标定位怎么定才精确?
Y yxjdelphi Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-17 #5 procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin a:=X; b:=Y; end; procedure TForm1.FormClick(Sender: TObject); begin //????GetCursorPos(ThePoint);谁告诉我tpoint是怎么回事?? popupMenu2.Popup(a,b);///好像不行呢??位置怎么回事,不过我想搞清楚后就很好用 //搞清楚通知我呀 end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin a:=X; b:=Y; end; procedure TForm1.FormClick(Sender: TObject); begin //????GetCursorPos(ThePoint);谁告诉我tpoint是怎么回事?? popupMenu2.Popup(a,b);///好像不行呢??位置怎么回事,不过我想搞清楚后就很好用 //搞清楚通知我呀 end;
磊 磊 Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-17 #7 procedure TForma.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if (button = mbRight) then popupMenu1.Popup(x+forma.ClientOrigin.x,y+forma.ClientOrigin.y); end;
procedure TForma.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if (button = mbRight) then popupMenu1.Popup(x+forma.ClientOrigin.x,y+forma.ClientOrigin.y); end;
N Nstar Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-17 #8 var p:TPoint; GetCursorPos(p);//取得当前鼠标单击位置 popupMenu1.popup(p.x,p.y);//在当前点弹出菜单
Y yxjdelphi Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-17 #9 //ntstar,要换算一下的,看我的,从你那里知道啦,p.x,p.y, begin GetCursorPos(ThePoint); ScreenToClient(thepoint); popupMenu2.Popup(thepoint.x,thepoint.y); end; //分点分吧
//ntstar,要换算一下的,看我的,从你那里知道啦,p.x,p.y, begin GetCursorPos(ThePoint); ScreenToClient(thepoint); popupMenu2.Popup(thepoint.x,thepoint.y); end; //分点分吧
B blackbutterfly Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-24 #10 我是想在(button.left,button.heignt+button.top) 这个位置出现popumenu 怎么办?
A ahhliang Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-22 #11 procedure TForm1.SpeedButton1Click(Sender: TObject); var thepoint : Tpoint; begin thepoint := speedbutton1.ClientOrigin; ScreenToClient(thepoint); popupMenu1.Popup(thepoint.x,thepoint.y); end;
procedure TForm1.SpeedButton1Click(Sender: TObject); var thepoint : Tpoint; begin thepoint := speedbutton1.ClientOrigin; ScreenToClient(thepoint); popupMenu1.Popup(thepoint.x,thepoint.y); end;