Results 1 to 3 of 3

Thread: ListView issue

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2010
    Posts
    195

    ListView issue

    I am using a listview which consits of all my computer's running processes. I added a refresh button on the form using the following code:

    Code:
    Private Sub Refresh_B_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Refresh_B.Click
    
            For i = 0 To Process_LV.Items.Count - 1
                If Process_LV.Items.Item(i).Text = cur_process Then
                    Process_LV.Focus()
                    Process_LV.Items.Item(i).Selected = True
                    Exit Sub
                End If
            Next
    
        End Sub
    The cur_process variable includes the name of the process i selected before the refresh. The code works fine and maintains this process selected even after the refresh. But the scrollbar goes at the top and not at the position of the selection. Any ideas?

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Oct 2010
    Posts
    195

    Re: ListView issue

    no one?

  3. #3
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: ListView issue

    Use Process_LV.Items(i).EnsureVisible()
    Last edited by Chris001; Feb 9th, 2012 at 05:32 PM.

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