See Code:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim oListView As New ListView
Dim oItem As ListViewItem
Dim cnt As Integer
Dim msg As String
Me.Controls.Add(oListView)
oListView.Dock = DockStyle.Fill
oListView.Columns.Add("Line #", 80, HorizontalAlignment.Right)
oListView.View = View.Details
For cnt = 1 To 100
msg = "LINE #: " & CStr(cnt)
oItem = oListView.Items.Add(msg, 0)
If cnt = 23 Then
oListView.Items(22).Selected = True
oListView.EnsureVisible(22)
End If
Next
End Sub
How come when I run the code, line 23 is selected (like I want), but if
I hit the down arrow, the selection moves to item 2 and NOT item 24. I
want it to move to item 24.
Can someone PLEASE help me.
Thanks.
Darin
*** Sent via Developersdex http://www.developersdex.com ***