Hello,
How to set caret in TRichView at X,Y coordinates position?
Regards,
Tomas
Set caret at x,y position
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Code: Select all
uses CRVFData;
var pt: TPoint;
RVData: TCustomRVFormattedData;
ItemNo, Offs: Integer;
pt := rve.ClientToDocument(Point(X, Y));
if rve.GetItemAt(pt.X, pt.Y, RVData, ItemNo, Offs, False) then begin
RVData := TCustomRVFormattedData(RVData.Edit);
RVData.SetSelectionBounds(ItemNo, Offs, ItemNo, Offs);
rve.TopLevelEditor.Invalidate;
end;