Set caret at x,y position
Posted: Mon Mar 13, 2006 3:38 pm
Hello,
How to set caret in TRichView at X,Y coordinates position?
Regards,
Tomas
How to set caret in TRichView at X,Y coordinates position?
Regards,
Tomas
Support forums for TRichView, ScaleRichView, Report Workshop and RVMedia components
https://textally.com/forums/
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;