|
-
Jun 28th, 2006, 09:34 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [2005] Listview scroll bar
Hi,
How do I make the scroll bar automatically scroll down while I am busy adding data onto the listview?
Thanks
PlayKid
-
Jun 28th, 2006, 10:26 AM
#2
Re: [2005] Listview scroll bar
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.
-
Jun 28th, 2006, 10:32 AM
#3
Thread Starter
Hyperactive Member
Re: [2005] Listview scroll bar
wow....Thanks so much, I never thought there can be a function for that.
-
Jun 28th, 2006, 10:46 AM
#4
Re: [2005] Listview scroll bar
no problem. Please mark the thread resolved if you got what you needed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|