-
Hello,
Below is a snippet of code I am using to fill up a LISTBOX with text from a file.
If Len(Dir(App.Path & "\TEST.LST")) <> 0 Then
Open App.Path & "\TEST.LST" For Input As #iFileNum
Do While Not EOF(iFileNum)
Line Input #iFileNum, STemp
List1.AddItem STemp
If Right$(STemp, 1) = "1" Then
List1.Selected(List1.NewIndex) = True
Else
List1.Selected(List1.NewIndex) = False
End If
Loop
Close #iFileNum
End If
I would like to "convert" this code to work with a LISTVIEW instead of a LISTBOX. Can this be done ?
Thanks,
-
Code:
Dim liEntry As ListItem
If Len(Dir(App.Path & "\TEST.LST")) <> 0 Then
Open App.Path & "\TEST.LST" For Input As #iFileNum
Do While Not EOF(iFileNum)
Line Input #iFileNum, STemp
Set liEntry = ListView1.ListItems.Add(, , STemp)
liEntry.Selected = IIf(Right$(STemp, 1) = "1", True, False)
Loop
Close #iFileNum
End If
-
Thanks...
...everything is working great, I just need to tweak the display of the items a little now.
Thanks again,