How to set cursor at the end of document ?
How to set cursor at the end of document ?
I want to implement 'entire scope' search (which is not implemented for RichViewEdit) and need to set cursor to the end of the document when direction is UP.
I'm using RVSetLinearCaretPos but don't know how to get the last symbol position number.
I'm using RVSetLinearCaretPos but don't know how to get the last symbol position number.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Just read the help
Same code as you posted above. Thanks.
Code: Select all
var
ItemNo, Offs: Integer;
...
ItemNo := MyRichViewEdit.ItemCount-1;
Offs := MyRichViewEdit.GetOffsAfterItem(ItemNo);
MyRichViewEdit.SetSelectionBounds(ItemNo,Offs,ItemNo,Offs);
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
What do you mean by "without changing position of the caret"? Not changed if nothing is found, or not changing at all?
May be you are searching for something like this:
http://www.trichview.com/forums/viewtopic.php?t=57
May be you are searching for something like this:
http://www.trichview.com/forums/viewtopic.php?t=57
Could not make this work
Hello,
I tried the code you suggested but to no avail. I got 'List index out of bounds (-1)' error. I added one item into RichView to test this in order to add text to the end of the document:
Thanks for any help.
I tried the code you suggested but to no avail. I got 'List index out of bounds (-1)' error. I added one item into RichView to test this in order to add text to the end of the document:
What is wrong? I'm trying this on Delphi 7.var
ItemNo, Offs: Integer;
...
ItemNo := MyRichViewEdit.ItemCount-1;
Offs := MyRichViewEdit.GetOffsAfterItem(ItemNo);
MyRichViewEdit.SetSelectionBounds(ItemNo,Offs,ItemNo,Offs);
Thanks for any help.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: