I use two Forms:
Form1 contains button1
Form2 contains button2 and Panel1
My project starts using Form2. Then I click on button2 to show Form1
private void button2_Click(object sender, EventArgs e)
{
Form1 Frm = new Form1();
Frm.Show();
}
Then on Form1, I click on button1 to hide Panel1 on Form2
private void button1_Click(object sender, EventArgs e)
{
Form2 FormInstance = new Form2();
FormInstance.displayInit();
FormInstance.Refresh();
}
displayInit() is a method inside Form2:
public void displayInit()
{
panel1.Visible = false;
}
But the panel is not hidden, due to a refresh issue, any idea please ?