I'm trying to develop a system where the user can scroll through a flowLayoutPanel, which contains a list on panels (which are created dynamically). Each panel has a pictureBox and two labels in it. When the user hovers the mouse over a panel, I want the background image of the panel to change.
So far I have made these methods:
private void pnlMouseHover(object sender, EventArgs e)
{
Panel panel1 = sender as Panel;
panel1.BackgroundImage = STUDIO2.Properties.Resources.buttonbackgroundmouseover;
}
private void pnlMouseLeave(object sender, EventArgs e)
{
Panel panel1 = sender as Panel;
panel1.BackgroundImage = STUDIO2.Properties.Resources.buttonbackground;
}
These work just fine, but when running the system these methods only run when the mouse is hovering over part of the panel which is not covered by a label or pictureBox.
How can I change this so when the mouse is hovering over the areas inside the panel, which are covered by a label or pictureBox, the background image changes?