Intersting question:
I created a little test bench and you will need to do what the above post says: when you hide the form, all the controls get their visible property set to false.
- private void button1_Click(object sender, EventArgs e)
-
{
-
if (label1.Visible == true)
-
{
-
label1.Visible = false;
-
}
-
else
-
{
-
label1.Visible = true;
-
}
-
}
-
-
private void button2_Click(object sender, EventArgs e)
-
{
-
Hide();
-
MessageBox.Show(label1.Visible.ToString(),"label1 Visible?",MessageBoxButtons.OK);
-
Show();
-
}
-
-
private void button3_Click(object sender, EventArgs e)
-
{
-
MessageBox.Show(label1.Visible.ToString(), "label1 Visible?", MessageBoxButtons.OK);
-
}
button 1 toggles the visibility of label1.
when I press button 2, which hides the form, the MB reports false.
when I press button3, which doesn't hide the form, the visibility of label1 is properly reported.