How do I add a MouseHover event to every existing button in a FlowLayoutPanel?
I want the mouse pointer to change to "Hand" when the mouse pointer is flipped on each button in this Panel and the background color of this button is a lighter blue
Code I tried to do:
private void frmMain_Load(object sender, EventArgs e)
{
foreach (Button bt in panelBotoes.Controls)
{
bt.MouseHover += new EventHandler(focarBotao(bt));
}
}
private EventHandler focarBotao(Button bt)
{
bt.BackColor = Color.LightBlue;
Cursor.Current = Cursors.Hand;
return ?;
}