|
-
May 28th, 2003, 09:07 AM
#1
Thread Starter
I wonder how many charact
Ignoring events
I have some dynamically created forms...
problem is (during test I did this), if you keep blindly clicking you sometimes BOUNCE - click (best way to describe it), so the mouse fires another event before the button is actually created, resulting in some errors in my program since the button contains data necessary to move on....
So how do I tell my application to throw any click events out the window until its ready to receive them?
-
May 28th, 2003, 09:24 AM
#2
Fanatic Member
Can you just set a form level variable (blnAcceptClick). Set it to false when you want to ignore clicks, and set to True when you want to accept them. Then in you click event handler you would test the blnAcceptClick and if false then Exit Sub - otherwise proceed.
Hope that helps.
-
May 28th, 2003, 09:30 AM
#3
Are you using WithEvents as part of your dynamic creation. If so, maybe you should consider using AddHandler to manually link events and not AddHandler for the click events until you are ready.
-
May 28th, 2003, 09:46 AM
#4
Thread Starter
I wonder how many charact
I was using AddHandler....
and I moved it into the Form Activated event... same problem.
Seems like either the event is firing twice from the old form...
Anyway its really irking me because it never happens when I try it in debug mode... (i'm attributing that to perhaps the program is running slower, although I can't physically tell the difference in speed)...
Unzip the following project.... http://www.sofa.com/dc.zip
Open the unzip folder...
execute the DinesenBravo shortcut first....
Then run the WindowsApplicatino13 shortcut....
Hit Start... New Sale .... (any sales rep)... any customer... (hit OK)...
When you get to the invoice screen... hit New Item
Click on the Jaymar button as fast as you can.... (clickin in the same spot)...
After the error occurs... do it again but this time at normal speed... it works...
-
May 28th, 2003, 09:55 AM
#5
When I click the Jaymar button, it goes directly to another screen etrememly fast. You cant click on Jaymar fast enough. Not humanly possible.
-
May 28th, 2003, 09:57 AM
#6
Thread Starter
I wonder how many charact
Oh just keep trying... you'll get it
No, its not a serious flaw... but it can happen... and no it doesn't crash the application... and the user could just try again... but it just irks me it exists...
-
May 28th, 2003, 09:59 AM
#7
No really. It is not possible to click Jaymar more than once on my system in a row. It is too fast. Like I said, no human could do it.
-
May 28th, 2003, 10:04 AM
#8
Fanatic Member
Maybe configure your mouse so that the right or left button acts as a double click. Then try it.
-
May 28th, 2003, 10:36 AM
#9
Thread Starter
I wonder how many charact
Can anyone else duplicate this behavior or is it just my Dell Optiplex?
-
May 28th, 2003, 10:39 AM
#10
Why not in the click event, go ahead and disable the image button, or something like that as the first line of code in the event?
-
May 28th, 2003, 01:26 PM
#11
Thread Starter
I wonder how many charact
Cander, yes when you click the button it goes to the next screen, but that's ok, because then you begin to replicate the behavior... keep clickin at the same spot.... and you'll go threw 2 more screens before you hit an error...
-
May 28th, 2003, 02:29 PM
#12
Fanatic Member
How about
VB Code:
If Sender Is btnFoo Then
MessageBox.Show("Boing")
End If
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
|