|
procedure TForm1.RichEdit1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var TextRange: TCharRange; atPos:Longint; mousePoint:TPoint; begin if Button = mbRight then begin RichEdit1.Perform(EM_EXGETSEL,0, Longint(@TextRange)); if TextRange.cpMin<>TextRange.cpMax then begin mousePoint.x:=x; mousePoint.y:=y; atPos:=RichEdit1.Perform(EM_CHARFROMPOS,0,Longint(@mousePoint)); if ( atPosTextRange.cpMax) then RichEdit1.Perform(WM_LBUTTONDOWN, MK_LBUTTON, MakeLong(X, Y)); end else RichEdit1.Perform(WM_LBUTTONDOWN, MK_LBUTTON, MakeLong(X, Y)); end |
[浏览:
次]
|