G
Guest
I have a list box that contains 4000 + lines that I have imported using the
fileopen function etc.
Once I have the data in the list box, I want to scroll through the lines in
the list box displaying the contains of each line in a text box that is on
the form. My command button scrolls through the loop but doesn't populate the
information in the text box as requested. I have copied the code below, can
somebody please advise me why the information is not appearing in the text
box.
I know that is is processing the items because if you see the lines of code
remed out .... If i = 100 then.... This displays the information.
Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Dim i As Integer
Dim ii As Integer
ii = 0
Dim strValue As String
For i = 0 To lstFiles.Items.Count - 1
txtTemp.Text = lstFiles.Items(i)
'If i = 100 Then
'MessageBox.Show("Test", txtTemp.Text)
'End If
Next i
' This all works
'Dim t As String
'If lstFiles.SelectionMode = SelectionMode.One Then
'txtTemp.Text = lstFiles.SelectedItem.ToString()
'End If
't = txtTemp.Text.Substring(0, 5)
'MessageBox.Show("Substring Test", t)
End Sub
fileopen function etc.
Once I have the data in the list box, I want to scroll through the lines in
the list box displaying the contains of each line in a text box that is on
the form. My command button scrolls through the loop but doesn't populate the
information in the text box as requested. I have copied the code below, can
somebody please advise me why the information is not appearing in the text
box.
I know that is is processing the items because if you see the lines of code
remed out .... If i = 100 then.... This displays the information.
Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Dim i As Integer
Dim ii As Integer
ii = 0
Dim strValue As String
For i = 0 To lstFiles.Items.Count - 1
txtTemp.Text = lstFiles.Items(i)
'If i = 100 Then
'MessageBox.Show("Test", txtTemp.Text)
'End If
Next i
' This all works
'Dim t As String
'If lstFiles.SelectionMode = SelectionMode.One Then
'txtTemp.Text = lstFiles.SelectedItem.ToString()
'End If
't = txtTemp.Text.Substring(0, 5)
'MessageBox.Show("Substring Test", t)
End Sub