Exactly where I must write this code?
button1.MouseHover += Common_MouseHover;
The problem is I want to declare one event handler and point each button at it. This is the common handler:
private void Common_MouseHover(object sender, EventArgs e)
{
Button btn = sender as Button;
if (btn != null)
btn.Image = pic
}
But I dont know where i must write:
button1.MouseHover += Common_MouseHover;
utton2.MouseHover += Common_MouseHover;
.. etc
In designer? Where exactly?
Either in the designer or the Constructor of your Form or if you are creating dynamic Buttons at the time of creation.
If in the Property Editor.