How to Scroll to the Bottom of a ListBox when Item

2019-09-09 13:43发布

I'd like to be able to create some sort of auto scrolling feature in a ListBox I have, where new data is added periodically to the ListBox. Items populating the ListBox are held in an ObservableCollection, and are always added to the end of the collection. Is there a way to make the ListBox auto scroll to the bottom every time a new item is added to the ObservableCollection and the View is updated?

1条回答
Luminary・发光体
2楼-- · 2019-09-09 14:31
listBox1.SelectedIndex = listBox1.Items.Count - 1;
listBox1.SelectedIndex = -1;
查看更多
登录 后发表回答