Answer the question
In order to leave comments, you need to log in
How to implement listbox scrolling down using code?
Good day.
How to make it so that, for example, on clicking a button, the ListBox (WPF) scrolls to the very bottom?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
There are several options.
Simple - use the ListBox.ScrollIntoView method - it allows you to scroll the ListBox to a specific element. If you need more precise scrolling
,
you need to get the ScrollViewer from the ListBox and work with it. For example, use the ScrollToBottom method.
To get a ScrollViewer, you can use the GetFirstDescendantOfType method.
var scrollViewer = myListBox.GetFirstDescendantOfType<ScrollViewer>();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question