Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
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-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated