Hi,
How do I make the scroll bar automatically scroll down while I am busy adding data onto the listview?
Thanks
PlayKid
Printable View
Hi,
How do I make the scroll bar automatically scroll down while I am busy adding data onto the listview?
Thanks
PlayKid
listviewitems have an EnsureVisible method, that will scroll the listview to make sure that item is in view. As you add each item, call that method on the newly added item, and it will scroll with it..
something like this
VB Code:
Dim lvi As ListViewItem = Nothing For i As Integer = 1 To 3000 lvi = New ListViewItem("Item " & i.ToString) ListView1.Items.Add(lvi).EnsureVisible() Application.DoEvents() Next
if you are not loading your list via a loop, and you are adding them manually (like filling in textboxes and clicking a button that inserts the listviewitem into the listview) then you shouldn't need the application.doevents.
wow....Thanks so much, I never thought there can be a function for that.
no problem. Please mark the thread resolved if you got what you needed ;)