Skip to content

Auto Scrolling #1296

Answered by tznind
cargotruck asked this question in Q&A
May 10, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

The TreeView will automatically 'scroll' even without any ScrollBarView. But for this to work correctly the bounds of the control need to be set correctly. In your example the height of the tree is 100, this means that it will only adjust the visible portion of the tree when you scroll down 100 rows in the tree. It will assume that all 100 rows it's bounds are 'visible'. This is consistent with the other controls like TextView and ListView.

You can get a scroll bar to render by using the approach shown in TreeViewFileSystem.cs. The example scenario in CatalogUI uses ScrollBarView (not ScrollView).

https://github.com/migueldeicaza/gui.cs/blob/0dd0f2e5c4965e1ec430439605a2dab6ff6d2114/UICata…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@cargotruck
Comment options

Answer selected by cargotruck
Comment options

You must be logged in to vote
1 reply
@BDisp
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants