I have a panel and inside the panel I have 12 buttons, which are invisible, I want that when mouse enters with the mouse panelEntered I expand a bit and show the buttons and when it comes out with mouseLeave go back to its normal form and hide.
private void cancha1_MouseEnter(object sender, EventArgs e)
{
cancha1.SetBounds(15, 18, 339, 174);
foreach (Control bt in this.cancha1.Controls)
{
bt.Visible = true;
}
foreach (Control bt in this.cp2.Controls)
{
bt.Visible = true;
}
}
private void cancha1_MouseLeave(object sender, EventArgs e)
{
cancha1.SetBounds(16, 19, 328, 163);
foreach (Control bt in this.cancha1.Controls)
{
bt.Visible = false;
}
foreach (Control bt in this.cp2.Controls)
{
bt.Visible = false;
}
}
The error is that when I enter the panel if I expand it and show it to me, but when I go over a button (without leaving the panel) it makes me small. I do not know how to do it so they do not change it. it is as if when you enter the component you will notice that it has left your container.