Page 1 of 1

Moving something into view

Posted: Sat Jan 19, 2008 1:49 am
by toolwiz
There are several methods of selecting text and items, eg. SetSelectionBounds.

How do you get the selected text to display around the (vertical) center of the main window if it's not in view?

The Search functions do it, but I can't tell how.

(In my app, you can highlight a string and record it's location, like a bookmark, which is saved in a ListView. Later on, you can double-click a line in the Listview, and I want to display the corresponding highlighted string in the main window. It's selecting the item, but not scrolling the window so the selected string is visible. How do I get it into view?)

Thanks

-David

Posted: Sat Jan 19, 2008 4:38 am
by proxy3d
Use function ScrollToCaret or
ScrollToItem (RVData: TCustomRVFormattedData; ItemNo: Integer)
where RVData = SRV.RichViewEdit. TopLevelEditor. RVData

Posted: Sat Jan 19, 2008 6:00 am
by toolwiz
excellent. Thanks!

-David