1
How do I add a Mousehover event to each existing button in a Flowlayoutpanel?
I want that when you hover the mouse on each button in this Panel the mouse pointer changes to "Hand" and that the background color of that button is a lighter blue
Code I tried to make:
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 ?;
}
It worked! Thank you very much!
– WitnessTruth