|
-
Jan 15th, 2012, 10:54 PM
#1
Thread Starter
New Member
1st mouse click does not fire
I have been working with VB for about five years. I am not a newbie, but I am not an expert either.
I have a simple program. It has a "Start" and an "Exit" button. When the "START" button is hit, I change the text on the exit button to read "STOP PROCESSING". Then I go into my processing loop.
When the "STOP PROCESSING" button is clicked the first time, the program simply ignores it. When I click it the SECOND time, it gets control. I know this because I put a breakpoint in at the start of the subroutine.
What could I possibly be doing to quash the firing the first time? Any ideas? Has anyone ever experience this kind of thing?
Thanks in advance
Dave
-
Jan 15th, 2012, 11:00 PM
#2
Re: 1st mouse click does not fire
If you're setting the Button Text to "Stop Processing" then presumably you are doing some processing. If you don't do that processing, does it still behave the same way?
-
Jan 16th, 2012, 09:36 AM
#3
Re: 1st mouse click does not fire
Can you show us what "processing" you are doing?
-
Jan 16th, 2012, 09:47 AM
#4
Hyperactive Member
Re: 1st mouse click does not fire
Could you post the code for the start button .click event?
A quick something to try, when you start the loop include a boolean value such as:
vbnet Code:
Dim loopstarted as boolean = false Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click IF loopstarted = False then loopstarted = True 'Start loop here including something like "Do until loopstarted = false" Else loopstarted = False End IF End Sub
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|