User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 375,227 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,262 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:

Loading A Text File into a Array into a Listbox

Join Date: May 2008
Posts: 5
Reputation: Sliders is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Sliders's Avatar
Sliders Sliders is offline Offline
Newbie Poster

Re: Loading A Text File into a Array into a Listbox

  #6  
May 9th, 2008
Sorry for double posting but I think I fixed the code to make it better, and it works to an extent.

Private Sub Chart_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim sr As IO.StreamReader = IO.File.OpenText("plane.txt")
        For row As Integer = 0 To 15
            For col As Integer = 0 To 6
                seat(row, col) = CStr(sr.ReadLine)
            Next
        Next
        listSeat.Items.Add("ABC DEF")
        'Do While sr.Peek <> -1
        ''''listSeat.Items.Add(seat(row, col))
        sr.Close()
    End Sub

I don't get any out of bounds errors or null exception errors, but it won't output the text file into the list box for some reason
Reply With Quote  
All times are GMT -4. The time now is 3:54 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC