After entering text into the textbox the user would click a button and each line in the textbox will become an item in the listbox.
Here's the code I have:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim ii As Integer
Dim a As String = ""
ii = TextBox1.Lines.Count()
ListBox1.Items.Clear()
For i As Integer = 1 To ii
a = TextBox1.Lines(i)
ListBox1.Items.Add(a)
Next i
End Sub
When I run it I get the following error "Index was outside the bounds of the array."
I'd very much apritiate it if someone could help me

New Topic/Question
Reply



MultiQuote




|