PC Review


Reply
Thread Tools Rate Thread

btn_Click event still happens after clicking

 
 
Ron
Guest
Posts: n/a
 
      8th Mar 2005
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
 
Reply With Quote
 
 
 
 
Hal Rosser
Guest
Posts: n/a
 
      8th Mar 2005
set the enabled property of the timer to false on the form's closing


 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      8th Mar 2005
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?


>-----Original Message-----
>set the enabled property of the timer to false on the

form's closing
>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Btn_Click event does not fire when used in a MasterPage Chad Gerber Microsoft ASP .NET 0 15th Mar 2006 01:48 AM
Can I mimic a btn_Click() ? Rick Microsoft Dot NET Compact Framework 3 20th Mar 2005 02:29 AM
Can I mimic a btn_Click()? Rick Microsoft C# .NET 1 8th Mar 2005 01:36 AM
Launch btn_click when press enter ? Patrice Nogueira Microsoft C# .NET 0 29th Jan 2004 10:18 AM
Re: btn_Click event has old form values Eric Johannsen Microsoft ASP .NET 0 8th Aug 2003 06:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:37 PM.