|
-
Oct 9th, 2000, 05:13 PM
#1
Thread Starter
Lively Member
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,
-
Oct 10th, 2000, 01:25 AM
#2
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
"It's cold gin time again ..."
Check out my website here.
-
Oct 10th, 2000, 01:47 PM
#3
Thread Starter
Lively Member
Thanks...
...everything is working great, I just need to tweak the display of the items a little now.
Thanks again,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|