Set item as first visible

General TRichView support forum. Please post your questions here
Post Reply
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Set item as first visible

Post by Jim Knopf »

Hi,

is there an easyer solution to set a specific item as the first visible then a loop with FirstVisible and VScroll?

Some items of a longer file have anchors. If user selects a number, this item is to be on top of the current window, is to be the first visible item. As clicking on a page anchor in browser.

thanks
Martin
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, I do not completely understand the question.

Do you want to scroll so that the specific item is shown at the top?

If the item is in the root document (not in a table cell), then

Code: Select all

rv.GetItemCoords(ItemNo, X, Y);
rv.ScrollTo(Y);
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Post by Jim Knopf »

Oh, so simple!
I knew that there would exist a more simple solution :-)

Thank you!
Post Reply