Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reliably scroll Virtual TreeView to the bottom?

A TVirtualStringTree object with custom node height, How to reliably scroll Virtual TreeView to the bottom (i.e. the scrollbar gets to the bottom)?

I tried calling tree1.FullExpand then tree1.ScrollIntoView.(tree1.GetLast), but it does not work.

Thank you in advance.

like image 486
Edwin Yip Avatar asked May 15 '10 08:05

Edwin Yip


Video Answer


1 Answers

ScrollIntoView works well for me. You can also try tree1.FocusedNode := tree1.GetLast;

Are you setting custom node height in OnMeasureItem event? If it doesn't work, try to set tree's DefaultNodeHeight to the bigger value and in OnMeasureItem event change it to lower. I noticed that tree recalculates scrollbar's length better that way.

like image 139
Linas Avatar answered Sep 28 '22 05:09

Linas