5

I have a TVirtualStringTree which is being used in report mode. It has a few columns and a vertical scroll bar, and works fine, except one thing.

When the last visible node is focused and I press the Down arrow key, the focus goes out of view, but the content of the tree view doesn't scroll up as expected. Pressing Up focuses the last visible line again.

enter image description here

Why does this happen? Which property did I miss to check/uncheck?

Victoria
  • 7,822
  • 2
  • 21
  • 44
Markus
  • 63
  • 6
  • 3
    Why would you expect the contents to scroll up when you pass the end? I doubt there's a property for this. – Jerry Dodge Jul 03 '18 at 15:51
  • I'd expect it to work like any other list I know: then the focused item is the last visible one but there are further list items all visible items scroll up one position, the next item is made visible and is now the focused one. In my situation focus simply goes out of view and if pressing cursor down further it goes further out of view without scrolling the list. Question now is: which property is the relevant one? – Markus Jul 03 '18 at 19:17
  • FWIW, with Delphi XE7 on Win 7, I can not reproduce. With the arrow keys (as well as with the scrollbar arrow buttons) scrolling stops at the last existing line and that also remains focused no matter how much I hammer the keybord (or s-bar buttons). – Tom Brunberg Jul 03 '18 at 21:40

1 Answers1

5

Exclude the toDisableAutoscrollOnFocus option from the TreeOptions.AutoOptions option set. This option is described (in code, by its declaration) like:

toDisableAutoscrollOnFocus

Disable scrolling a node or column into view if it gets focused.

Victoria
  • 7,822
  • 2
  • 21
  • 44