well this runs as expected
Dim bstop As Boolean = True
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim icount As Integer
Do Until bstop = False
'there's some code here
'etc, etc
Debug.WriteLine(icount.ToString)
Application.DoEvents()
icount += 1
Loop
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
bstop = False
End Sub
so the problem is probably in the part where there is some code :-)
you need doevents in this case to let the thread check the state of the
boolean
otherwise you would have an endless loop wich might also depending on the
code that is in the loop result in out of memory ( out of stack ) exceptions
or other unpredictable results :-)
regards
"Jason Molt" wrote:
Do until bStop = False
'there's some code here
'etc, etc
Loop
'some more code here
And then, I have a button that sets bStop = False when clicked: the program
blows up, fatal exception. What the...?
// fark0