Click here to Skip to main content
15,887,585 members
Home / Discussions / C#
   

C#

 
QuestionMono.Cecil (IL Manipulation) : What's OpCode ? Pin
hdv21228-Jul-09 10:55
hdv21228-Jul-09 10:55 
AnswerRe: Mono.Cecil (IL Manipulation) : What's OpCode ? Pin
Curtis Schlak.28-Jul-09 13:50
Curtis Schlak.28-Jul-09 13:50 
QuestionMessage Removed Pin
28-Jul-09 9:10
professionalN_tro_P28-Jul-09 9:10 
AnswerRe: Can this be refractored Pin
martin_hughes28-Jul-09 12:41
martin_hughes28-Jul-09 12:41 
Questionbutton onclick event Pin
djg28-Jul-09 8:57
djg28-Jul-09 8:57 
AnswerRe: button onclick event Pin
musefan28-Jul-09 9:29
musefan28-Jul-09 9:29 
GeneralRe: button onclick event Pin
djg28-Jul-09 9:57
djg28-Jul-09 9:57 
GeneralRe: button onclick event [modified] Pin
musefan28-Jul-09 10:19
musefan28-Jul-09 10:19 
djg wrote:
I could use timers or threads, but I try to avoid them.


Timers is debatable, but not using threads (especially with the ease of Background Workers) is a big mistake. Like I have said, running code that will take more than a second (or even less) should not hold up the UI thread, this leads to bad user experience as in most cases the application will appear to crash/freeze and more than likely display the "Not Responding" message, which just makes the application look bad.

When a process is called on the UI thread then the form is not automatically updated until control has been return to it (so to speak). Unless you specifically 'interrupt' the function and tell it to do so.
Try my suggestion of using Refresh after you disable the button (which should be your first two lines within the event BTW) and see if that stops multiple clicks.

And if your counting the number of button clicks during the actual process then you should reset the counter to 1 at the start of each click, otherwise you are storing number of button clicks since form was created. - Sorry, a moment of stupidity D'Oh! | :doh:


I strongly suggest attempting to use a background worker if you have not done so before.

Life goes very fast. Tomorrow, today is already yesterday.

modified on Tuesday, July 28, 2009 4:58 PM

AnswerRe: button onclick event Pin
PIEBALDconsult28-Jul-09 9:29
mvePIEBALDconsult28-Jul-09 9:29 
GeneralRe: button onclick event Pin
djg28-Jul-09 10:05
djg28-Jul-09 10:05 
GeneralRe: button onclick event Pin
musefan28-Jul-09 10:28
musefan28-Jul-09 10:28 
GeneralRe: button onclick event Pin
PIEBALDconsult28-Jul-09 10:38
mvePIEBALDconsult28-Jul-09 10:38 
AnswerRe: button onclick event Pin
PIEBALDconsult28-Jul-09 10:03
mvePIEBALDconsult28-Jul-09 10:03 
QuestionArticle not added yet !!! Pin
HiteshSharma28-Jul-09 8:17
HiteshSharma28-Jul-09 8:17 
AnswerRe: Article not added yet !!! Pin
DaveyM6928-Jul-09 8:22
professionalDaveyM6928-Jul-09 8:22 
AnswerRe: Article not added yet !!! Pin
PIEBALDconsult28-Jul-09 8:27
mvePIEBALDconsult28-Jul-09 8:27 
AnswerRe: Article not added yet !!! Pin
Robin_Roy28-Jul-09 23:55
Robin_Roy28-Jul-09 23:55 
GeneralRe: Article not added yet !!! Pin
HiteshSharma29-Jul-09 0:01
HiteshSharma29-Jul-09 0:01 
QuestionModal form from modal form Pin
RobScripta28-Jul-09 7:39
professionalRobScripta28-Jul-09 7:39 
AnswerRe: Modal form from modal form Pin
musefan28-Jul-09 7:54
musefan28-Jul-09 7:54 
AnswerRe: Modal form from modal form Pin
Alan N28-Jul-09 7:56
Alan N28-Jul-09 7:56 
AnswerRe: Modal form from modal form Pin
Abhishek Sur28-Jul-09 7:56
professionalAbhishek Sur28-Jul-09 7:56 
GeneralRe: Modal form from modal form Pin
RobScripta28-Jul-09 8:19
professionalRobScripta28-Jul-09 8:19 
GeneralRe: Modal form from modal form Pin
Abhishek Sur28-Jul-09 22:12
professionalAbhishek Sur28-Jul-09 22:12 
QuestionXMLwriter error Pin
newXMLdeveloper28-Jul-09 7:00
newXMLdeveloper28-Jul-09 7:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.