Auto Scrolling a ListBox

  • Thread starter Thread starter Stephen Martindale via .NET 247
  • Start date Start date
S

Stephen Martindale via .NET 247

Hi,

I am using a ListBox (System.Windows.Forms.ListBox) on myapplication's data import form to show the progress of thetransaction as it is happening. I want it to scroll downautomatically as I add items to it. The items will not besorted, and the list box must always show the most recent itemadded (the one on the bottom.)

I am adding items like "Successfully connected to..." and"Imported ... number 1234 ..." to the list. I add items in manydifferent places, so it would be best if I could cause theautomatic scrolling to run on an event that is fired whenever anitem is added to the list, instead of having to update the codewherever I add items to the list box.

I have found many examples on this site and others of how toautomatically scroll a RTF and text box, but nothing for listboxes.

Please Help
Stephen
 
* Stephen Martindale via .NET 247 said:
I have found many examples on this site and others of how to automatically scroll a RTF and text box, but nothing for list boxes.

Have a look at its 'TopIndex' property.
 
Back
Top