I have a form with 6 buttons. These buttons serve to increase/decrease tha value of the respective textbox. Now I\'m trying to \"animate\" the buttons. I want to get another eff
if one effect should be applied for all buttons, try to add the same event handlers to them
private void btn_MouseHover(object sender, EventArgs e)
{
(sender as Button).Image = Game_Helper.Properties.Resources.DownHover;
}
private void btn_MouseLeave(object sender, EventArgs e)
{
(sender as Button).Image = Game_Helper.Properties.Resources.Down;
}
button which raised event is available via sender
variable
this way you avoid code duplication for every button. creating a ButtonBehaviour
or CustomButton
is probably an over-engineering unless you need them in many forms