Results 1 to 3 of 3

Thread: [RESOLVED] [02/03] Listview: show selected item

  1. #1

    Thread Starter
    Member Aaron_Redmond's Avatar
    Join Date
    Mar 2006
    Location
    Ireland
    Posts
    34

    Resolved [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

  2. #2
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: [02/03] Listview: show selected item

    look for Listview's EnsureVisible method,sure that will help you
    __________________
    Rate the posts that helped you

  3. #3

    Thread Starter
    Member Aaron_Redmond's Avatar
    Join Date
    Mar 2006
    Location
    Ireland
    Posts
    34

    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
  •  



Click Here to Expand Forum to Full Width