Article ID: 145683
Article Last Modified on 11/18/2003
Option Explicit
Private Sub Form_Load()
Dim LI As ListItem
Dim i As Integer
For i = 1 To 3
Set LI = listview1.ListItems.Add(, , "Test " & i)
LI.Selected = True
Next i
Debug.Print "SelectedItem = " & listview1.SelectedItem.Text
For i = 1 To 3
Debug.Print listview1.ListItems(i).Text & ", Selected = " _
& listview1.ListItems(i).Selected
Next i
End Sub
LI.Selected = True
to:
Set ListView1.SelectedItem = LI
Running the project after this change has been made will cause the
expected output (that is, the Text property of SelectedItem is now 'Test
3') to be displayed in the debug window.
Additional query words: 4.00 vb4win vb432
Keywords: kbbug KB145683