-
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?
-
Re: ListView issue
-
Re: ListView issue
Use Process_LV.Items(i).EnsureVisible()