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

C#

 
GeneralRe: App with Crystal Reports Pin
CodingYoshi29-Jul-09 6:01
CodingYoshi29-Jul-09 6:01 
GeneralRe: App with Crystal Reports Pin
Ennis Ray Lynch, Jr.29-Jul-09 6:04
Ennis Ray Lynch, Jr.29-Jul-09 6:04 
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 
Hmmm... very strange process. I assume you have done so just to play around with things.

your code is currently being executed on the UI thread when the button is clicked. This means that until the event process has been complete then the form will not be updated. You can use functions like Update or Refersh (like you have with label1) in order to make a change to the display/layout of the form/control. If you do not do so then it will only occur once the function is complete. So basically, even thou you are disabling the button in the function it will not be applied until the function is complete, but by then you have already enabled the button again.. So no change will be applied. You could try refreshing the button after you disable it and that should work (not tried before thou).

I would recommend that you take a look into Background Workers[^] as these can be used to process longer functions on a separate thread, thus freeing up the form for continued user interaction. There are alos a number of Timer Components[^] you may want to have a look at too.

djg wrote:
if (button1.Enabled == false)
return;


Unless you are planning to 'emulate' the button click by calling the function specifically from code then you should not need to include that code. If you only ever use function when button is clicked by user than this should only ever evaluate to be false anyway

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

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 
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 

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.