Popular Posts

Wednesday, February 16, 2011

To display a form as a MDI child


HERE :FormName is the name of the Form
            formobject is the object of the form

CODE SNIPPET:
            FormName formobject = new FormName();
             MasterPage MDI = (MasterPage)this.ParentForm;
             formobject.MdiParent = this.ParentForm;
             formobject.Location = new Point(0, 0);
             formobject.StartPosition = FormStartPosition.Manual;
             formobject.Show();
             formobject.TopLevel = false;
             formobject.Parent = MDI.panel1;
             formobject.Dock = DockStyle.Fill;
             formobject.AutoScroll = true;
             this.Close();

No comments:

Post a Comment