Can someone help me?
I'm trying to write code for a counter from zero to 1000. But there are some things I can't find:
- When I click start it only shows 0 and 1000. How can I make that I can see all the numbers (0, 1, 2, 3, ..., 999,1000)?
- How can I make it stop when I click the stop button? And that it goes further if I click the start button again?
This is what I got and that works:
CODE
Public Class FrmCounter
Private Sub BtnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnStart.Click
Dim counter As Integer = 0
While (counter < 1000)
counter = counter + 1
LblCounter.Text = counter
End While
End Sub
Private Sub BtnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnReset.Click
'Put counter back to zero
LblCounter.Text = "0"
End Sub
Private Sub BtnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnStop.Click
End Sub
End Class