本文整理自网络,侵删。
procedure TForm1.RichEdit1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);var vPoint: TPoint;begin if Button <> mbRight then Exit; vPoint := Point(X, Y); X := SendMessage(RichEdit1.Handle, EM_CHARFROMPOS,0, Integer(@vPoint)) and $0000FFFF;// 得到鼠标点击字符位置 if (X >= RichEdit1.SelStart) and (X <= RichEdit1.SelStart + RichEdit1.SelLength) then ShowMessage(RichEdit1.SelText);end;
来路:http://www.cnblogs.com/key-ok/p/3359027.html
相关阅读 >>
Delphi ioutils 单元(5): tdirectory.tdirectory 的其他功能
Delphi vcl 模式下和firemonkey 模式下的字符串
更多相关阅读请进入《Delphi》频道 >>