btn_Click event still happens after clicking

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
 
R

Ron

Thanks for your reply. Actually, I was already doing
that. Turns out that my problem was/is that I am using
SendKeys to click off a System level error dialog box that
comes up after I finish running a DTS Package routine from
the VB app. I forgot about my SendKeys call - hokey way
to turn off the error message but it was all I could come
up with. It seems that VB2003 doesn't not do real well
with the DTS packages - probably because the DTS package
is based on COM. I think this problem gets fixed in
VB2005 since they have the Bulk Sql Class for bulk reading
data to Sql Server.

Anyone know if VS2005 is out in production yet?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top