-
In my programm there's listbox (List1) and a text-box,
which I can save in a Text-File. The first line of the
textfile is the text form the textbox and the following
lines are from the listbox. (Method from OneSource)
-> How must I write the code, that the first line gets
into a textbox and the rest into the listbox when I open
the file ?
For this programm I use VB 3.0 (but normally this isn't a
problem)
Thanks for some advice, Matt ;) :)
[hr]
-
Code:
Dim bFilledTextBox as Boolean
Dim sLine as String
lstRestofFile.Clear
Open "c:\filename.txt" For Input As #1
Line Input #1, sLine
Do While not Eof(1)
If not bFilledTextBox Then
txtFirstLine.Text = sLine
bFilledTextBox = True
Else
lstRestofFile.Add sLine
End if
Line Input #1, sLine
Loop
Close(1)