Hello,
I want to move the focus to a certain Item in an TRichViewEdit,
that means the Item should be shown appr. in the middle of
the TRichViewEdit then. Any hints?
Thanks and greetings
Udo
TRichViewEdit: Move focus centered to a certain Item
-
- Site Admin
- Posts: 17524
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
You can move caret to the end of this item. If this item is not in table cell, and you know its index (ItemNo), the code is:
The editor will be scrolled to show the caret, but not necessary in the middle of window.
Code: Select all
rve.SetSelectionBoudns(ItemNo, rve.GetOffsAfterItem(ItemNo),
ItemNo, rve.GetOffsAfterItem(ItemNo));
Pardon me for intruding. It seems to me that you want to move an item to the middle of the screen without moving TRichView itself which is like changing the content itself. Why not move the form so that the item looks as if it is in the center of the screen (This way you are not changing the contents of rv at all).
Cheers.
Cheers.