Hello everyone,
I am using Visual Basic Community 2022. I have one button and one textbox, eventually there will be more buttons and textboxes. Anyway, I have the following code for my button:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Static count As Integer
count = count + 1
TextBox1.Text = count
End Sub
I want the button clicks to be counted in the textbox. I have also created a reset button. Now, my problem is when I click on reset the textbox shows 0 but when I click the counter button again, the count continues from where it left off. What I want is for the count to reset back to 0. Could someone please tell me what to do. I am new to coding and not sure what to do. Thank you.
I am using Visual Basic Community 2022. I have one button and one textbox, eventually there will be more buttons and textboxes. Anyway, I have the following code for my button:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Static count As Integer
count = count + 1
TextBox1.Text = count
End Sub
I want the button clicks to be counted in the textbox. I have also created a reset button. Now, my problem is when I click on reset the textbox shows 0 but when I click the counter button again, the count continues from where it left off. What I want is for the count to reset back to 0. Could someone please tell me what to do. I am new to coding and not sure what to do. Thank you.