P
Paul Anderson
I have a newbie question that I hope someone can answer.
VB Studio 2005
I have a form with a button and a listbox. When the button is pressed
the following routine is run:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim wrap As String
wrap = Chr(13) & Chr(10)
For i = 1 To 10
TextBox1.Text = TextBox1.Text & "Loop " & i & wrap
System.Threading.Thread.Sleep(1000)
Next i
End Sub
End Class
All this does is populate the listbox with loop1,loop2, etc with a crlf
at the end of each loopx.
While this is running I can see that the listbox is getting bigger
because the elevator bar is created and successively gets smaller as
more loops are run. However the words ("loopx") do not appear in the
listbox until the entire 10 iterations of the loop are complete.
Can anyone tell me why this happens? Is there a cure? Can I make it so
that each "loopx" line appears successively once per second in the box?
Thank you.
Paul Anderson
VB Studio 2005
I have a form with a button and a listbox. When the button is pressed
the following routine is run:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim wrap As String
wrap = Chr(13) & Chr(10)
For i = 1 To 10
TextBox1.Text = TextBox1.Text & "Loop " & i & wrap
System.Threading.Thread.Sleep(1000)
Next i
End Sub
End Class
All this does is populate the listbox with loop1,loop2, etc with a crlf
at the end of each loopx.
While this is running I can see that the listbox is getting bigger
because the elevator bar is created and successively gets smaller as
more loops are run. However the words ("loopx") do not appear in the
listbox until the entire 10 iterations of the loop are complete.
Can anyone tell me why this happens? Is there a cure? Can I make it so
that each "loopx" line appears successively once per second in the box?
Thank you.
Paul Anderson