You have declared an delegate with second parameter of type EventArgs
. However in your main you are subscribing to it with handler that does not accept EventArgs
but rather its subclass. Compiler cannot make a conversion here.
You can solve this by declaring delegate to accept your specific arguments:
public delegate void buttonChange(object sender, buttonChangeArgs e);
Besides that most likely your Main
is a static method (I assume you are writing a console application). In that case your usage of buttonChangeNeeded
is not valid since it is not static (at least from what we can see).