Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ListView1.View = View.Details ListView1.FullRowSelect = True ListView1.GridLines = True ListView1.Columns.Add("ID", 40) For i As Integer = 0 To 20 ListView1.Items.Add(i) Next End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ListView1.Items(10).Selected = True ListView1.Select() End Sub End Class
MSDN wrote:Ensures that the item is visible within the control, scrolling the contents of the control, if necessary.
ListView1.Items(10).EnsureVisible()
Button1_Click
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ListView1.Items(10).Selected = True ListView1.Items(10).EnsureVisible() ListView1.Select() End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)