我必须在哪里写这段代码?
button1.MouseHover += Common_MouseHover;
问题是我想声明一个事件处理程序并将每个按钮指向它。这是常见的处理程序:
private void Common_MouseHover(object sender, EventArgs e)
{
Button btn = sender as Button;
if (btn != null)
btn.Image = pic
}
但我不知道我必须在哪里写:
button1.MouseHover += Common_MouseHover;
utton2.MouseHover += Common_MouseHover;
.. etc
在设计师?具体在哪里?