R
Ron
Hello,
I have a button click event that opens two forms from a
main form which has a timer on it. After the two forms
get opened, I perform some procedures with them then close
these two forms down. Then the button on the main form re-
clicks itself and the two forms open up again. How can I
prevent this from happening? Here is the code for the
button on the main form:
Private Sub btnManual_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnManual.Click
Static i As Integer
Console.WriteLine("frmMain btnManual i is " & i.ToString)
If i < 1 Then
Console.WriteLine("starting forms from btnManual " &
i.ToString)
frm1a = New frm1
frm1a.Show()
frm2a = New frm2
frm2a.Show()
End If
i += 1
If i > 3 Then i = 0
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Timer1.Tick
...stuff
End Sub
Is there something in the Timer or btn_Click arguments
that is causing the button to re-click itself?
Thanks,
Ron
I have a button click event that opens two forms from a
main form which has a timer on it. After the two forms
get opened, I perform some procedures with them then close
these two forms down. Then the button on the main form re-
clicks itself and the two forms open up again. How can I
prevent this from happening? Here is the code for the
button on the main form:
Private Sub btnManual_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnManual.Click
Static i As Integer
Console.WriteLine("frmMain btnManual i is " & i.ToString)
If i < 1 Then
Console.WriteLine("starting forms from btnManual " &
i.ToString)
frm1a = New frm1
frm1a.Show()
frm2a = New frm2
frm2a.Show()
End If
i += 1
If i > 3 Then i = 0
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Timer1.Tick
...stuff
End Sub
Is there something in the Timer or btn_Click arguments
that is causing the button to re-click itself?
Thanks,
Ron