Listbox focus always on the last line/item added? [C# 2002]

Shaitan00

Junior Contributor
Joined
Aug 11, 2003
Messages
358
Location
Hell
This is going to be fun to explain...
I am using the LISTBOX (lbOutput) as a way to output information to the user (via the lbOutput.items.add(sInfo);) - when the listbox itself gets full the scrollbars appear except that the focus remains at the top of the listbox.

As lines keep getting added the user has to scroll DOWN to see the information. I need the opposite, I need to ensure the Listbox will always show the LAST ITEM ADDED at all times, if the user wants to see what happened before he can easily scroll up using the scroll bars. Kind of like how the command prompt works.

I went through the ListBox properties and was unable to find anything to that effect - any ideas?
Any help would be greatly appreciated...
Thanks,
 
Why not just select the last item each time you add an item...
Code:
listBox1.SelectedIndex = listBox1.Items.Count - 1;
 
Back
Top