I making a custom button, and I need to add a PreviewKeyDown event, whenever i add a Click event. What i got so far is:
public new event EventHandler Click {
add {
base.Click += value;
foreach (Control i in Controls) {
i.Click += value;
}
}
remove {
base.Click -= value;
foreach (Control i in Controls) {
i.Click -= value;
}
}
}
this adds the click event to everything, but i need to add one method to a click event AND a PreviewKeyDown event at the same time in winforms. its for a custom button, so it can perform a method when someone hits enter
if something is unclear just comment and ill clarify
Completed code: