I have a method that I want to invoke both on the TextChanged
and Validating
events. The problem is that the e
parameter of TextChanged
is of type EventArgs
while the e
parameter of Validating
is of type CancelEventArgs
.
I could obviously do something like this:
void TextBox_TextChanged(object sender, EventArgs e) => Method();
void TextBox_Validating(object sender, CancelEventArgs e) => Method();
but I wonder if there is an option to make both events to have the same event handler.