How to make a scrollbar follow the last comment in a listBox in C #?

4

I'm creating a Chat in C #, which will serve as an interaction between a User and an Analyst, as a means to a Service Order, so far I'm getting it and I've already been able to make the connection correctly for enter the chat.

My problem is that as you type in the listbox the scrollbar does not follow the last comment and stays up, and does not go down following the comments.

I would like to know how I can make the scrollbar follow the comments, without having to make the user use scrollbar at all times.

OBS: I do not think it's necessary to post any part of the codes, as it will not help much because it will not have much relevance in the problem issue.

    
asked by anonymous 18.05.2016 / 08:33

1 answer

5

Select the last item in the list:

listbox.SelectedIndex = listbox.Items.Count - 1;
    
18.05.2016 / 09:19