Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have added follwing in my MDIParent1.cs file

C#
public static Form1 frm1 = new Form1();
        public static Form2 frm2 = new Form2();
        public static Form3 frm3 = new Form3();

C#
private void MDIParent1_Load(object sender, EventArgs e)
        {

            frm1.MdiParent = this;
            frm2.MdiParent = this;
            frm3.MdiParent = this;
            frm1.Show();
        }


Then I set the WindowsState property of all three forms to Maximized.

in Form1.cs
C#
private void button1_Click(object sender, EventArgs e)
       {
                      this.Hide();
           MDIParent1.frm2.Show();
       }

in Form2.cs
C#
private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            MDIParent1.frm3.Show();

        }

in Form3.cs
C#
private void button1_Click(object sender, EventArgs e)
        {
            MDIParent1.frm1.Show();
            this.Hide();
        }



I don't problem when I click on buttons of Form1, 2 resp. once.
but wen I press Button of Form3 I get Form1 not in maximized form but in restored form.
I want that form1 to appear in Maximized state.
Wat should I do?
Please Help
Posted

1 solution

I got an alternative solution
MIDL
frm1.Dock = DockStyle.Fill;
            frm2.Dock = DockStyle.Fill;
            frm3.Dock = DockStyle.Fill;


but still I wanna know why the forms do not appear maximized when the second time they are showed
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900