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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sascha BPosted Mar 22, 2011, 9:17 AM
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 BPosted Mar 22, 2011, 9:24 AM
Antony FoxPosted Mar 22, 2011, 9:23 AM
Antony FoxPosted Mar 22, 2011, 9:10 AM
Sascha BPosted Mar 22, 2011, 9:07 AM
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?