5 Replies - 5121 Views - Last Post: 22 December 2008 - 09:06 AM Rate Topic: -----

#1 sssmartie  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 59
  • Joined: 03-June 08

Mdi child form keeps appearing under the textbox of Mdi parent.How can

Post icon  Posted 22 December 2008 - 05:42 AM

Hi,
I'm working on a Mdi notepad. The main parent form of the notepad has a multilined textbox and a menu which has a menu option named "Window" which contains an "Add new window" submenu item and on it's click event, it has to show a new notepad window(an Mdi child) as the following:
Form2 f=new Form2;//form2  has  been added to the solution before
f.MdiParent = this;
f.Show();



The problem here is that when I click on the "Add new window" submenu item, it adds an Mdi child form under the textbox of the parent window therefore the child form can not be seen. Any idea on how I can make the child window appear over the textbox of the parent form?
Thank you in advance. :)

Is This A Good Question/Topic? 0
  • +

Replies To: Mdi child form keeps appearing under the textbox of Mdi parent.How can

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: Mdi child form keeps appearing under the textbox of Mdi parent.How can

Posted 22 December 2008 - 07:54 AM

should the parent form have a textbox? I would think that, ideally, when the parent form opens, it would create a new "Form2", similar to how Microsoft Word does it, if that's that you are going for. So at startup, the parent form would create a new Form2, then if the user clicked "Add new window", then another "Form2" would be created. So there would now be two "Form2"'s inside the parent MDI.
Was This Post Helpful? 0
  • +
  • -

#3 sssmartie  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 59
  • Joined: 03-June 08

Re: Mdi child form keeps appearing under the textbox of Mdi parent.How can

Posted 22 December 2008 - 08:13 AM

Yes the parent form should have a textbox and as you mentioned it should create a new "Form2" similar to how Microsoft Word does it when "Add new window" is clicked (the parent form is Form1 in the project a form that is different from Form2) .Any idea on how I can make the Form2 child apppear over the parent form's texbox?
Thank you.
Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: Mdi child form keeps appearing under the textbox of Mdi parent.How can

Posted 22 December 2008 - 08:32 AM

what is the name of the MDI form? Which form do you have the "IsMdiContainer" property set to true?

This post has been edited by eclipsed4utoo: 22 December 2008 - 08:34 AM

Was This Post Helpful? 0
  • +
  • -

#5 sssmartie  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 59
  • Joined: 03-June 08

Re: Mdi child form keeps appearing under the textbox of Mdi parent.How can

Posted 22 December 2008 - 08:52 AM

The parent form is form1. Form1 is the mdi container.The are 2 forms in this project one is the parent form (Form1) and the other is Form2 which the child has to be created from.
Was This Post Helpful? 0
  • +
  • -

#6 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: Mdi child form keeps appearing under the textbox of Mdi parent.How can

Posted 22 December 2008 - 09:06 AM

I believe it is designed that any control of the parent MDI is always on top.
Was This Post Helpful? 1

Page 1 of 1