I have the following: private void ButtonClick(object sender, EventArgs e)
When I add to the parameter list, to make: private void ButtonClick(object sender, EventArgs e, Class c) then it will cause all sorts of problems. However, I need really want in my main:
Class c = new Class();
And then I would like to click a button so that ButtonClick is called, but I really need access to the "Class c" in the function body, so I really need
private void ButtonClick(object sender, EventArgs e, Class c)
to compile somehow.
I have tried other ways around the issue, such as making Class static, but it would create too much refactoring and cause other errors.
I don't know if this will be possible in Windows Forms. I am not opposed to switching over to XAML and WPF, I just want to know that doing something such as
private void ButtontClick(object sender, EventArgs e, Class c)
will be possible.