G
Guest
Hi,
I would like to do have the following method:
AssignMethodToButtonClick(myButton_Click, myButton);
This would be equivalent do:
myButton.Click+=new EventHandler(myButton_Click);
Why... To add keyboard support to my application I want to make a class that
will assign events to controls in a choosen form. Now depending on which form
the user is, I handle the KeyDown events differently (switch... case...).
Currently I have to copy the whole thing into each single form, but I would
like to make a clean separate class and be able to change the handling
function at runtime.
How could I do this?
Thanks,
Sitar.
I would like to do have the following method:
AssignMethodToButtonClick(myButton_Click, myButton);
This would be equivalent do:
myButton.Click+=new EventHandler(myButton_Click);
Why... To add keyboard support to my application I want to make a class that
will assign events to controls in a choosen form. Now depending on which form
the user is, I handle the KeyDown events differently (switch... case...).
Currently I have to copy the whole thing into each single form, but I would
like to make a clean separate class and be able to change the handling
function at runtime.
How could I do this?
Thanks,
Sitar.