I want to pass the value of variable r into the button1_click method. I have attatched my code
I keep getting this error > Error 1 No overload for 'button1_Click' matches delegate 'System.EventHandler'
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sascha B122 reputationPosted Mar 22, 2011, 5:17 AM EDT
If so, double click on you button which you placed on your form1 and paste your code in it
and writer above public Form1() "int r = 0;"
and in your Form1_load area paste this code
Now your r variable is global and you don't have to parse it to your button click event
Sascha B122 reputationPosted Mar 22, 2011, 5:07 AM EDT
It is just a method.
normally it says something like this
Did you just changed the parameters? If so, you have to add this method to the button class.
If not. Why not using the r variable global and asking for it in the normal button click event?
Antony Fox10 reputationPosted Mar 22, 2011, 5:10 AM EDT
Antony Fox10 reputationPosted Mar 22, 2011, 5:23 AM EDT
Sascha B122 reputationPosted Mar 22, 2011, 5:24 AM EDT