﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » Command button Click event firing twice when user double click it.</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 03:38:00 GMT</lastBuildDate><ttl>20</ttl><item><title>Command button Click event firing twice when user double click it.</title><link>http://forum.strataframe.net/FindPost29030.aspx</link><description>Hi guys,&lt;br/&gt;&lt;br/&gt;I am having a situation where some users are double clicking a command button and its Click() event is being fired twice, is there a way to prevent this?&lt;br/&gt;&lt;br/&gt;I have done some research in Google but could not find an easy solution, other than creating a timer to handle the click.&lt;br/&gt;&lt;br/&gt;Thanks!</description><pubDate>Fri, 19 Nov 2010 11:34:50 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Command button Click event firing twice when user double click it.</title><link>http://forum.strataframe.net/FindPost29051.aspx</link><description>Thanks Greg, very good information about those events.</description><pubDate>Fri, 19 Nov 2010 11:34:50 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Command button Click event firing twice when user double click it.</title><link>http://forum.strataframe.net/FindPost29046.aspx</link><description>Here's some info on how the click/double-click events play together: [url=http://msdn.microsoft.com/en-us/library/system.windows.forms.control.doubleclick.aspx]&lt;font style="font-family: Arial;" size="2"&gt;Control&lt;span&gt;.&lt;/span&gt;DoubleClick Event&lt;/font&gt;&lt;font size="2"&gt;&lt;span style="font-family: Arial;"&gt;[/url]&lt;/span&gt;&lt;/font&gt;.&amp;nbsp; This supports the advice to disable further clicks until the process is completed.</description><pubDate>Fri, 19 Nov 2010 09:30:34 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Command button Click event firing twice when user double click it.</title><link>http://forum.strataframe.net/FindPost29043.aspx</link><description>Now that I gave it some more thinking, I do have some buttons that start long processing that I disable as soon as they get clicked... and not only them, many of the form controls that are waiting for a click, so the user won't get a chance to mess it up.</description><pubDate>Fri, 19 Nov 2010 09:07:21 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Command button Click event firing twice when user double click it.</title><link>http://forum.strataframe.net/FindPost29041.aspx</link><description>[quote][b]Russell Scott Brown (11/19/2010)[/b][hr]I know if FoxPro I often run into problems with people, especially older ones, double-clicking on command buttons like crazy for some reason.&amp;nbsp; Also have the issue where they do 2 single-clicks instead of 1 double-click because they are mouse challenged.[/quote]&lt;br/&gt;Hi Russell,&lt;br/&gt;&lt;br/&gt;That is good to know, but I did reproduced the issue with a very fast double click and was surprised to see my process running twice.</description><pubDate>Fri, 19 Nov 2010 08:19:19 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Command button Click event firing twice when user double click it.</title><link>http://forum.strataframe.net/FindPost29040.aspx</link><description>Hello Edhy.&amp;nbsp; &lt;br/&gt;&lt;br/&gt;I know if FoxPro I often run into problems with people, especially older ones, double-clicking on command buttons like crazy for some reason.&amp;nbsp; Also have the issue where they do 2 single-clicks instead of 1 double-click because they are mouse challenged.&lt;br/&gt;&lt;br/&gt;Anyway, this workaround is good to know.&amp;nbsp; Thanks</description><pubDate>Fri, 19 Nov 2010 08:14:21 GMT</pubDate><dc:creator>Russell Scott Brown</dc:creator></item><item><title>RE: Command button Click event firing twice when user double click it.</title><link>http://forum.strataframe.net/FindPost29038.aspx</link><description>Well, you should have seen my face when I got the call from the user reporting that my process was running twice &lt;span&gt;:crying:&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;At least I have only get one call on this specific process, so for now fixing this button will be enough.&amp;nbsp; Hmmm, never got that complaint using Visual FoxPro &lt;span&gt;&lt;/span&gt;&lt;span&gt;:w00t:&lt;/span&gt; but did get others &lt;span&gt;:satisfied:&lt;/span&gt;</description><pubDate>Fri, 19 Nov 2010 07:38:02 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Command button Click event firing twice when user double click it.</title><link>http://forum.strataframe.net/FindPost29035.aspx</link><description>Nope, never thought of it. But it does make sense it runs twice, since the user clicked the thing twice. &lt;br/&gt;&lt;br/&gt;I think we could put a message "Can you please give the application some time to do its job?!" to the user, and of course, use the Localization and Messaging Editor to create a key to this message, so we do it in all languages possible. :D</description><pubDate>Fri, 19 Nov 2010 04:27:18 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Command button Click event firing twice when user double click it.</title><link>http://forum.strataframe.net/FindPost29032.aspx</link><description>Hi Ivan,&lt;br/&gt;&lt;br/&gt;Thanks for the prompt response.&amp;nbsp; Yes that does the trick even though it is weird that a double click action would be registered twice.&amp;nbsp; This mean that now I would have to re-test all my buttons or create a subclass to do the enable/disable trick.&lt;br/&gt;&lt;br/&gt;Is this also happening to you?</description><pubDate>Thu, 18 Nov 2010 19:16:25 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Command button Click event firing twice when user double click it.</title><link>http://forum.strataframe.net/FindPost29031.aspx</link><description>Hi Edhy.&lt;br/&gt;&lt;br/&gt;Would disable the button once it enters the Click event work? And then Enable it back once you finish everything you want to do inside it?</description><pubDate>Thu, 18 Nov 2010 19:07:49 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>