By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,117 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,117 IT Pros & Developers. It's quick & easy.

combo box

jamesd0142
100+
P: 469
hi this code reads the first value from my file into my combobox...

Dim ioFile As New StreamReader(Application.StartupPath & "\" & "Favourites.txt")
If File.Exists(Application.StartupPath & "\" & "Favourites.txt") Then
'MsgBox(Application.StartupPath & "\" & "Favourites.txt")

Dim a As String = Application.StartupPath & "\" & "Favourites.txt"
Dim ioLine As String ' Going to hold one line at a time
'While
ioLine = ioFile.ReadLine
cboFavourites.Items.Add(ioLine)
'End While
End If

ioFile.close()

How can i edit it to read all values?

Thanks James
Sep 21 '07 #1
Share this Question
Share on Google+
1 Reply


jamesd0142
100+
P: 469
Dim i As Integer = 0
Dim ioFile As New StreamReader(Application.StartupPath & "\" & "Favourites.txt")
If File.Exists(Application.StartupPath & "\" & "Favourites.txt") Then
'MsgBox(Application.StartupPath & "\" & "Favourites.txt")

Dim a As String = Application.StartupPath & "\" & "Favourites.txt"
Dim ioLine As String ' Going to hold one line at a time


ioLine = ioFile.ReadLine
cboFavourites.Items.Add(ioLine)
While Not ioLine = ""
ioLine = ioFile.ReadLine
cboFavourites.Items.Add(ioLine)
i += 1
End While
End If

fixed is ud like to know...
Sep 21 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.