• Log in or sign up for an account here: https://www.sythe.org/login

writing all items in listbox [problem]

Supah Fly

Active Member

Banned
Joined
Aug 22, 2007
Sythe Gold
0
Messages
202
Location
your face
Code:
        For i = 0 To ListBox4.Items.Count() - 1
            If ListBox4.SelectedIndex = i Then
                ListBox4.SelectedIndex = i + 1
            Else
                ListBox4.SelectedIndex = 0
            End If
            wrf.WriteLine(ListBox4.SelectedItem)
        Next

Ive tried alot to solve this problem, probably me being really tired.

What it does is write all the items in a listbox, i thought of a few different ways and i guess this way would be the best. selecting every index and writing its value.

i guessed wrong.

fix please?

came up with this...

Code:
        oWrite = oFile.CreateText(SaveFileDialog1.FileName)
        Dim i As Integer, s As String
        For i = 0 To ListBox4.Items.Count - 1
            s = ListBox4.Items.Item(i)
            oWrite.WriteLine(s)
        Next i
        oWrite.Close()

It works. Fixed it myself.
 
Runescape Gamblingrunescape gambling
Back
Top