How to make a particular line to topmost?
How to make a particular line to topmost?
How can I make the line where the cursor is, to the topmost of a TRichViewEdit?
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: How to make a particular line to topmost?
Do you want to scroll to show the caret on top?
The simplest code is:
The simplest code is:
Code: Select all
var
R: TRect;
ItemPart: Integer;
...
with RichViewEdit1.TopLevelEditor do
begin
ItemPart := RVData.GetItemPart(CurItemNo, OffsetInCurItem,
IsCaretAtTheBeginningOfLine);
RichViewEdit1.GetItemCoordsEx(RVData, CurItemNo, ItemPart, False, R);
end;
RichViewEdit1.ScrollTo(R.Top);
Re: How to make a particular line to topmost?
Perfect, that's it. Thank you!