W wjiachun Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-19 #2 GetCursorPos( var lpPoint: TPoint {receives coordinates of cursor} ): BOOL; {returns TRUE or FALSE}
K kucio Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-19 #3 procedure TForm1.FormDblClick(Sender: TObject); var Pos:TPoint; begin GetCursorPos(Pos); //Pos.x,Pos.y分别表示鼠标的横纵坐标 end;
procedure TForm1.FormDblClick(Sender: TObject); var Pos:TPoint; begin GetCursorPos(Pos); //Pos.x,Pos.y分别表示鼠标的横纵坐标 end;
F Fyx Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-23 #5 双击是两个单击,在MouseDown中的x,y就是坐标: procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin Caption := IntToStr(x) + ',' + IntToStr;; end; 但如果只在双击时才窗口客户区双击的位置就得用GetCursorPos了: procedure TForm1.FormDblClick(Sender: TObject); var P: TPoint; begin GetCursorPos(P); Caption := IntToStr(P.x) + ',' + IntToStr(P.y); end;
双击是两个单击,在MouseDown中的x,y就是坐标: procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin Caption := IntToStr(x) + ',' + IntToStr;; end; 但如果只在双击时才窗口客户区双击的位置就得用GetCursorPos了: procedure TForm1.FormDblClick(Sender: TObject); var P: TPoint; begin GetCursorPos(P); Caption := IntToStr(P.x) + ',' + IntToStr(P.y); end;
杀 杀大龙 Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-23 #6 同意, 嘻嘻,。。 注意 uses shellapi; 哈哈,我也想赚几分。。 :)
H hhzh426 Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-27 #7 在form的ondblclick事件中: GetCursorPos获取鼠标的位置(屏幕坐标) 用form1.ScreenToClient方法获取相对于客户区的坐标值。