|
-
May 27th, 2008, 08:28 AM
#1
Thread Starter
Member
[RESOLVED] [02/03] Listview: show selected item
Hi all. I have searched the forum with no luck, hopefully you can help me.
I have listview which contains around 500 different items.
I have a search function which will find any item in this listview and set its background colour to blue.
My problem is I that I want the listview to automatically scroll to the selected item, how can I do this.
Code:
For i_Rows = 0 To Me.ListView1.Items.Count - 1
If Me.ListView1.Items(i_Rows).SubItems(2).Text = s_Search_Text Then
Me.ListView1.Items(i_Rows).BackColor = Color.Blue
Me.ListView1.Select()
Exit For
End If
Next
Thanks
-
May 27th, 2008, 08:32 AM
#2
Re: [02/03] Listview: show selected item
look for Listview's EnsureVisible method,sure that will help you
__________________
Rate the posts that helped you 
-
May 27th, 2008, 08:34 AM
#3
Thread Starter
Member
Re: [02/03] Listview: show selected item
Thanks man, that was driving me crazy.
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
|