combo box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    combo box

    hi this code reads the first value from my file into my combobox...

    Dim ioFile As New StreamReader(Ap plication.Start upPath & "\" & "Favourites.txt ")
    If File.Exists(App lication.Startu pPath & "\" & "Favourites.txt ") Then
    'MsgBox(Applica tion.StartupPat h & "\" & "Favourites.txt ")

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

    ioFile.close()

    How can i edit it to read all values?

    Thanks James
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    #2
    Dim i As Integer = 0
    Dim ioFile As New StreamReader(Ap plication.Start upPath & "\" & "Favourites.txt ")
    If File.Exists(App lication.Startu pPath & "\" & "Favourites.txt ") Then
    'MsgBox(Applica tion.StartupPat h & "\" & "Favourites.txt ")

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


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

    fixed is ud like to know...

    Comment

    Working...