problem with windows application
-
Hi, I am working on a windows application involving MDI forms and child forms. The problem here is when I click an item in the menu bar I am displaying a child form. the child form should be in such a way that it is displayed inside the MDI form and should not be like popup box.I have done this as shown below. Childfrm.TopLevel=False; this.Panel1.Controls.Add(Childfrm); Childfrm.show(); it's working well but the controlbox with title bar is being displayed seperately in maximised mode.I want the control box beside MDI form menu and child form title beside mdi form title. A very good example of this functionality is Edit plus. I request any one who worked on this type of requirement to help me in solving this problem Thanks in advance
-
Hi, I am working on a windows application involving MDI forms and child forms. The problem here is when I click an item in the menu bar I am displaying a child form. the child form should be in such a way that it is displayed inside the MDI form and should not be like popup box.I have done this as shown below. Childfrm.TopLevel=False; this.Panel1.Controls.Add(Childfrm); Childfrm.show(); it's working well but the controlbox with title bar is being displayed seperately in maximised mode.I want the control box beside MDI form menu and child form title beside mdi form title. A very good example of this functionality is Edit plus. I request any one who worked on this type of requirement to help me in solving this problem Thanks in advance
-
Try setting the IsMdiChild property of Childfrm to true, setting this.IsMdiContainer to true, and setting Childfrm.MdiParent to this
Between the idea And the reality Between the motion And the act Falls the Shadow
Hi thanks for ur reply. but it's not not working. The code is given below. //childform.IsMdiChild = true; childform.MdiParent = this; childform.TopLevel = false; splitContainer1.Panel2.Controls.Add(childform); childform.Show(); the first line is giving an error saying "Property or indexer 'System.Windows.Forms.Form.IsMdiChild' cannot be assigned to -- it is read only".
-
Hi thanks for ur reply. but it's not not working. The code is given below. //childform.IsMdiChild = true; childform.MdiParent = this; childform.TopLevel = false; splitContainer1.Panel2.Controls.Add(childform); childform.Show(); the first line is giving an error saying "Property or indexer 'System.Windows.Forms.Form.IsMdiChild' cannot be assigned to -- it is read only".
If TopLevel is false, the form can no longer be an MdiChild.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
If TopLevel is false, the form can no longer be an MdiChild.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...but i need it since I should show the child window within the mdi form.It should not look like a popup window. thanks and regards
-
but i need it since I should show the child window within the mdi form.It should not look like a popup window. thanks and regards
Well, you're going to have to change your design. An MdiParent form cannot be an MdiChild to another MdiParent. About the best you're going to get would be to write code that handles the Move and Resize events of the child form you want and contrain it to the boundries of the MdiParent's MdiClient area, or an MdiChild form's boundries. No, I don't have sample code because I've never needed to to anything like that.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...