How to scroll to bottom of ListBox?

前端 未结 3 2030
眼角桃花
眼角桃花 2020-12-10 00:27

I am using a Winforms ListBox as a small list of events, and want to populate it so that the last event (bottom) is visible. The SelectionMode is set to none. T

3条回答
  •  爱一瞬间的悲伤
    2020-12-10 01:01

    Scroll to the bottom:

    listbox.TopIndex = listbox.Items.Count - 1;

    Scroll to the bottom, and select the last item:

    listbox.SelectedIndex = listbox.Items.Count - 1;

提交回复
热议问题