Posted: Tue Apr 30, 2013 4:14 pm
Moving to the end of line requires using undocumented methods and properties
Code: Select all
uses CRVFData, RVERVData;
procedure GoToEndOfLine(rve: TCustomRichViewEdit);
var DItemNo, DOffs, ItemNo, Offs: Integer;
RVData: TRVEditRVData;
begin
RVData := TRVEditRVData(rve.TopLevelEditor.RVData);
DItemNo := RVData.CaretDrawItemNo+1;
while (DItemNo<RVData.DrawItems.Count) and not RVData.DrawItems[DItemNo].FromNewLine do
inc(DItemNo);
dec(DItemNo);
DOffs := RVData.GetOffsAfterDrawItem(DItemNo);
RVData.DrawItem2Item(DItemNo, DOffs, ItemNo, Offs);
RVData.SetSelectionBounds(ItemNo, Offs, ItemNo, Offs);
end;