I have an application in C#, and I added one button to show and hide panel2, but when clicked the panel 2 is works perfect to showing and hide itself. but something wrong when click the button show/hide panel2 gives a quick black things, i don't know how to fix it.
this is my show/hide button syntax:
if (Panel2.Visible == false) {
Panel2.BackColor = Color.Transparent;
Panel2.Visible = true;
PictureBox2.Image = Properties.Resources.downmen;
} else {
Panel2.BackColor = Color.Transparent;
Panel2.Visible = true;
Panel2.Visible = false;
PictureBox2.Image = Properties.Resources.upmen;
}