Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
AnswerRe: Urgent Help Pin
Eddy Vluggen27-Nov-12 12:55
professionalEddy Vluggen27-Nov-12 12:55 
GeneralRe: Urgent Help Pin
OriginalGriff27-Nov-12 21:08
mveOriginalGriff27-Nov-12 21:08 
AnswerRe: Urgent Help Pin
fjdiewornncalwe28-Nov-12 11:54
professionalfjdiewornncalwe28-Nov-12 11:54 
AnswerRe: Urgent Help Pin
BobJanova28-Nov-12 23:16
BobJanova28-Nov-12 23:16 
QuestionHow to prevent multiple button clicks Pin
MichCl27-Nov-12 10:15
MichCl27-Nov-12 10:15 
AnswerRe: How to prevent multiple button clicks Pin
Eddy Vluggen27-Nov-12 12:48
professionalEddy Vluggen27-Nov-12 12:48 
GeneralRe: How to prevent multiple button clicks Pin
MichCl28-Nov-12 8:31
MichCl28-Nov-12 8:31 
AnswerRe: How to prevent multiple button clicks Pin
lukeer27-Nov-12 20:17
lukeer27-Nov-12 20:17 
<quote>
C#
btn_Program.Enabled = false;

Are you sure that btn_Program is the correct button to disable?

Since you aren't sure to have started an ASP.NET project, I will assume you have a Windows Forms project instead. That would mean that you have a button click event handling routine somewhere that looks similar to this:
C#
void btn_Program_Click(object sender, EventArgs e)
{
   // ... your code here ...
}

To definitely disable the correct button, you can use the sender parameter:
C#
void btn_Program_Click(object sender, EventArgs e)
{
   // Disable the button whose Click event started this method
   System.Windows.Forms.Button methodStartingControl = sender as System.Windows.Forms.Button;
   if(methodStartingControl != null)
   {
       methodStartingControl.Enabled = false;
   }

   // ... your code here ...

   // Re-enable the previously-disabled button
   if(methodStartingControl != null)
   {
       methodStartingControl.Enabled = true;
   }
}


Ciao,


luker

GeneralRe: How to prevent multiple button clicks Pin
MichCl28-Nov-12 7:40
MichCl28-Nov-12 7:40 
GeneralRe: How to prevent multiple button clicks Pin
MichCl28-Nov-12 7:41
MichCl28-Nov-12 7:41 
QuestionTop books for learning C# (Complete novice) for thermodynamic mathematical modelling Pin
Mahdi Kapateh27-Nov-12 8:05
Mahdi Kapateh27-Nov-12 8:05 
AnswerRe: Top books for learning C# (Complete novice) for thermodynamic mathematical modelling Pin
Richard MacCutchan27-Nov-12 9:53
mveRichard MacCutchan27-Nov-12 9:53 
AnswerRe: Top books for learning C# (Complete novice) for thermodynamic mathematical modelling Pin
Nelek27-Nov-12 12:37
protectorNelek27-Nov-12 12:37 
GeneralRe: Top books for learning C# (Complete novice) for thermodynamic mathematical modelling Pin
Richard MacCutchan27-Nov-12 23:47
mveRichard MacCutchan27-Nov-12 23:47 
GeneralRe: Top books for learning C# (Complete novice) for thermodynamic mathematical modelling Pin
Nelek28-Nov-12 11:47
protectorNelek28-Nov-12 11:47 
AnswerRe: Top books for learning C# (Complete novice) for thermodynamic mathematical modelling Pin
Matt T Heffron27-Nov-12 12:59
professionalMatt T Heffron27-Nov-12 12:59 
GeneralRe: Top books for learning C# (Complete novice) for thermodynamic mathematical modelling Pin
Mahdi Kapateh28-Nov-12 3:04
Mahdi Kapateh28-Nov-12 3:04 
QuestionDynamically loading a plug-in assembly by interface Pin
MJL Rademakers27-Nov-12 4:07
MJL Rademakers27-Nov-12 4:07 
AnswerRe: Dynamically loading a plug-in assembly by interface Pin
Alan N27-Nov-12 4:27
Alan N27-Nov-12 4:27 
GeneralRe: Dynamically loading a plug-in assembly by interface Pin
MJL Rademakers27-Nov-12 4:41
MJL Rademakers27-Nov-12 4:41 
AnswerRe: Dynamically loading a plug-in assembly by interface Pin
Pete O'Hanlon27-Nov-12 4:30
mvePete O'Hanlon27-Nov-12 4:30 
GeneralRe: Dynamically loading a plug-in assembly by interface Pin
MJL Rademakers27-Nov-12 4:45
MJL Rademakers27-Nov-12 4:45 
AnswerRe: Dynamically loading a plug-in assembly by interface Pin
PIEBALDconsult27-Nov-12 8:17
mvePIEBALDconsult27-Nov-12 8:17 
GeneralRe: Dynamically loading a plug-in assembly by interface Pin
BobJanova28-Nov-12 23:49
BobJanova28-Nov-12 23:49 
GeneralRe: Dynamically loading a plug-in assembly by interface Pin
PIEBALDconsult29-Nov-12 2:41
mvePIEBALDconsult29-Nov-12 2:41 

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.