C
C
This does not show me all the plots (all variables in List1). It shows
the last plot, and usually goes blank in between. What am I doing
wrong?
Private Sub cmdAll_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdAll.Click
Dim i As Short
For i = 1 To N ' N is a global public variable
Call cmdClear_Click(sender, e)
List1.SelectedIndex = i - 1
Call cmdPlot_Click(sender, e)
Threading.Thread.Sleep(3000)
Next
End Sub
I think I found the answer. I should have added Application.DoEvents()
in the For loop. Sleep(3000) is not the problem.
I had expected that Me.Invalidate() : g.Dispose() would force the
Paint process, so it would not be necessary to do anything else, but
why am I wrong?
the last plot, and usually goes blank in between. What am I doing
wrong?
Private Sub cmdAll_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdAll.Click
Dim i As Short
For i = 1 To N ' N is a global public variable
Call cmdClear_Click(sender, e)
List1.SelectedIndex = i - 1
Call cmdPlot_Click(sender, e)
Threading.Thread.Sleep(3000)
Next
End Sub
I think I found the answer. I should have added Application.DoEvents()
in the For loop. Sleep(3000) is not the problem.
I had expected that Me.Invalidate() : g.Dispose() would force the
Paint process, so it would not be necessary to do anything else, but
why am I wrong?