-
September 25th, 2012, 01:41 AM
#1
[RESOLVED] Double Click on Command Button ?
I am having trouble replicating the problem, but from what I am seeing seems to suggest that an operator has somehow caused a process to run twice - my only explanation at this point is that perhaps they have clicked twice on a command button, causing the process to repeat itself (and in doing so, mess up the results and file updates).
When the operator completes the invoice they click on a command button which activates the CLICK Event
eg, What if the operators mouse was programmed to do a double click every time it was clicked once ?
Has anyone else had a similar experience (or am I completely on the wrong track)
Appreciate any feedback - happens infrequently but when it happens I lose an invoice
-
September 25th, 2012, 07:02 AM
#2
Re: Double Click on Command Button ?
From your description I couldn't see how your question is related to VB6.
If you have VB6 source, you can add some debug.print information to check an trace how your command button is executed twice.
-
September 25th, 2012, 08:02 AM
#3
Re: Double Click on Command Button ?
Last edited by George1111; September 25th, 2012 at 08:17 AM.
-
September 25th, 2012, 08:07 AM
#4
Re: Double Click on Command Button ?
The button is a VB6 Command Button on a VB6 Form (I have all the source code - Its my program)
The click event causes code to be run which I am starting to believe has been run twice
Under windows you are able to configure the mouse to send a double click when a single click is made - I was just wondering if anyone had experienced anything similar
Configuring the mouse click behaviour (in the Control Panel) does not care if you are running VB6, VB.Net or Launching Interent Explorer - it will send a double click if thats the way it is configured
What I will try is to set a flag the instant that the command button is clicked, so that I can test if the procedure has been activated - this way I may be able to trap a "second" launch of the click event
I was just interested to hear if anyone else had experienced something similar (or is my theory totally wrong)
Thanks for your interest
-
September 25th, 2012, 08:44 AM
#5
Re: Double Click on Command Button ?
Something similar yes, but not exactly. Double execution in my case was caused by a complex code, from somewhere in the program event was re-fired. My approach was to trace some debug info to a log file, monitor code execution to find from which point it was re-fired.
-
September 25th, 2012, 03:31 PM
#6
Re: Double Click on Command Button ?
Haven't had a double click on the same button issue. I have had an issue where I had 2 panels one overlays the other and each with a button in the same location. When the button is clicked the top panel becomes invisible and sometimes the click will cause the button underneath to click also. I temporarly disable the underlying button to stop this from happening.
I'm not sure a double click would fire the click event twice though. Several controls have both a click and a double click event and I have never saw the click event fire twice from a double click, it could be different with a button where there is no double click event to fire but then yoru problem could be elsewhere.
You may try adding as the first line in your click event a line to disable the button then later on in that same event enable it again. This may take care of the problem if that is in fact what is happening.
Always use [code][/code] tags when posting code.
-
September 26th, 2012, 01:10 AM
#7
Re: Double Click on Command Button ?
Strangely enough, it may also be the mouse itself. Especially Optical mouses ( mice ), I am battling with mine sometimes clicking twice when it is not supposed to. I'd also Disable the button after it was clicked on, as DM suggested. Another not so viable ( I suppose ) option would be to use the SystemParametersInfo API with the SPI_SETMOUSE to set the mouse double click speed
-
September 28th, 2012, 11:30 AM
#8
Re: Double Click on Command Button ?
Originally Posted by HanneSThEGreaT
Strangely enough, it may also be the mouse itself. Especially Optical mouses ( mice ), I am battling with mine sometimes clicking twice when it is not supposed to. I'd also Disable the button after it was clicked on, as DM suggested. Another not so viable ( I suppose ) option would be to use the SystemParametersInfo API with the SPI_SETMOUSE to set the mouse double click speed
I had a mouse that was double-clicking, and even moving the cursor at random. Just plain random clicks and moves - really messed things up if I let it persist. Turned out to be the chip in the mouse was going flaky. A new mouse solved it.
As for setting the double-click speed, probably not a good idea to alter the user's system settings. Better just to check the value, and if it's way off, notify the user. But either way, disabling the button should solve it if the button is indeed being clicked twice. Although there is the question of how long before enabling the button again. A timer could be enabled at the end of the code within the click event, and the timer could then disable itself, and enable the button.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
September 28th, 2012, 04:56 PM
#9
Re: Double Click on Command Button ?
I had some issues with my mouse as well. I used to play a game which popped up a menu when you clicked the mouse then dissappeared when you clicked again. The mouse was hitting double clicks about 3 out of 4 times no matter how careful you were so what would happen is the menu would popup and dissappear before you could make a selection. Sometimes you would accidently make a selection depending on the exact position of the mouse at the time.
Very frustrating but a new mouse fixed the issue.
After doing some testing here with a command button it looks like that type of mouse problem could cause the button click to fire twice.
Always use [code][/code] tags when posting code.
-
October 1st, 2012, 10:19 PM
#10
Re: Double Click on Command Button ?
Thanks guys
I think I'll go with the disable button after click
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
|