0

hey, I have created two forms. in one form there is a panel, which is
Form1:

Panel1.visibel = false;

Form2: When the

WindowState == FormWindowState.Minimized

then the panel1 in form1 needs to be visible, but how to do that ? :S

Waleed Ahmed

3
Contributors
12
Replies
15
Views
5 Years
Discussion Span
Last Post by vadriaan
0

change the "Modifiers" property of the panel of Form1 to "protectedinternal" so that it can be accessible from Form2

0

Yes i did, this is the code i inserted in the form2 :)

if (this.WindowState == FormWindowState.Minimized)
            {
                Form1 dlg = new Form1();
                dlg.panel7.Visible = true;
            }

this code is in form2_Load

0

first you have to show the form then only the panel will be visible i guess

Form1 dlg = new Form1();
dlg.Show();
dlg.panel7.Visible = true;
0

Nope, the both forms are running. i dont make any of the form visible = false :)
plizz help :)

0

Do i need to use an if statement ?
and if i need to how would it be like and where to put it. I dont think the code i am using is right in the form_load function

0

Without an IF statment:

WindowState == FormWindowState.Minimized
dlg.panel7.Visible = true;
dlg.panel7.BringToFront();

or with it:

IF (WindowState.IsMinimized)
{
   dlg.panel7.Visible = true;
   dlg.panel7.BringToFront();
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.