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
 
 
 
 
 
TitleLoad a ListBox using the lines in a file
Keywordsadditem, ListBox, line, file
CategoriesControls
 
Use Line Input# to read the file and add 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
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated