Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If Plastic >= 2 Then Plastic = Plastic - 2 Timer1.Interval = 5000 Timer1.Enabled = True Me.Button2.Enabled = False MsgBox("Bla will be done after 5 seconds. Buttons will be enabled again after Bla is produced!") Else MsgBox("2 pieces of plastic required!") End If End Sub
Code of timer:
If Timer1.Interval = 0 Then MsgBox("Good(s) are done!") Me.Button2.Enabled = True Good = Good + 1 Form3.Label1.Text = Good Timer1.Enabled = False
Now, when I press the button, the button gets disabled, but nothing happens afterwards. The good doesn't get produced, I don't get a msgbox that it is done and the button doesn't get enabled again. Please help somebody...