How do I get a scrollbar to follow the last comment on a listbox in C#?

Asked

Viewed 133 times

4

I am creating a Chat on C#,which will serve as an interaction between a User and an Analyst,being as a means to a Service Order,so far I am managing and I have managed to make sure that there is the correct connection to enter Chat.

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

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

OBS : I believe that it is not necessary to post some part of the codes, because it will not help much and will not have much relevance in the issue of my problem.

  • Your system is Windows or Web?

  • My system is Windows.

1 answer

5


Select the last item in the list:

listbox.SelectedIndex = listbox.Items.Count - 1;
  • After adding the message to the list...

  • 3

    It worked, thank you very much friend,+1 and also gave as answer that helped me :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.