Home
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
 
 
 
 
TitleCopy the lines in a file into a ListBox
Keywords
CategoriesControls
 
Open the file and use Line Input to read it one line at a time, adding each line to the ListBox.
 
Private Sub cmdLoad_Click()
Dim fnum As Integer
Dim file_line As String

    lstLines.Clear

    fnum = FreeFile
    Open txtFile.Text For Input As fnum
    Do While Not EOF(fnum)
        Line Input #fnum, file_line
        lstLines.AddItem file_line
    Loop
End Sub
 
See also Load data from a text file into ListBoxes.
 
 
Copyright © 1997-2001 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated