7 Replies - 11827 Views - Last Post: 17 April 2019 - 04:21 AM Rate Topic: -----

#1 astradyne   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-February 09

Opening an MDI Child Form from a Child Form

Posted 25 February 2009 - 01:55 AM

Hi All

I'm creating an application that uses an MDI container to create a sort of desktop style for my form with a group of icons docked to the left hand side. The rest of the form is the desktop area that I want all windows to open in.

If I use the standard File-New option that is provided by VB as a default for the MDI container this works fine and a child window is loaded.

If I use similar code from one of the icons this also works fine.

My problem is that one of my child forms is a search panel and when I double click on one of the results I want a window to open, but as an MDI child. However, this doesnt happen. When I open the window it opens as a completely separate window and isn't docked within the MDI parent. It also appears on the task bar as a separate application.

I have tried setting the MDIParent of the new form to the original MDI parent, but this has no effect.

Is it possible to do what I want with MDI or am I barking up the wrong tree?

Thanks

Jonathan

Is This A Good Question/Topic? 0
  • +

Replies To: Opening an MDI Child Form from a Child Form

#2 Muzafar   User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 23
  • Joined: 25-February 09

Re: Opening an MDI Child Form from a Child Form

Posted 25 February 2009 - 03:16 AM

When you are opening a form from another MID Child form you need to open it as follows:-

For example the form to be opened is named childForm, it will be opened as follows:-

childForm cf= new childForm();
cf.MdiParent = this.MdiParent; 
cf.Show();


Hope that helps ...

This post has been edited by born2c0de: 25 February 2009 - 07:30 AM

Was This Post Helpful? 0
  • +
  • -

#3 astradyne   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-February 09

Re: Opening an MDI Child Form from a Child Form

Posted 25 February 2009 - 07:09 AM

View PostMuzafar, on 25 Feb, 2009 - 02:16 AM, said:

When you are opening a form from another MID Child form you need to open it as follows:-

For example the form to be opened is named childForm, it will be opened as follows:-

childForm cf= new childForm();
cf.MdiParent = this.MdiParent;
cf.Show();

Hope that helps ...

Muzafar

Thank you very much for that, you're a star.

I'll try it as soon as I get home tonight and let you know how I get on.

All the best

Jonathan
Was This Post Helpful? 0
  • +
  • -

#4 born2c0de   User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 187
  • View blog
  • Posts: 4,673
  • Joined: 26-November 04

Re: Opening an MDI Child Form from a Child Form

Posted 25 February 2009 - 07:32 AM

@astradyne:
I think Muzafar's asking for code in VB.NET, not C#.

The conversion is pretty simple in this case, so I hope Muzafar doesn't experience any difficulty converting it. :)
Was This Post Helpful? 0
  • +
  • -

#5 astradyne   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-February 09

Re: Opening an MDI Child Form from a Child Form

Posted 25 February 2009 - 05:22 PM

Hi born2cOde

Thanks for that, it was actually Muzafar answering my question. I hadn't realised his answer was in C#, but I was able to adapt it and it works perfectly.

All the best

Jonathan
Was This Post Helpful? 0
  • +
  • -

#6 naveen2006   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-April 19

Re: Opening an MDI Child Form from a Child Form

Posted 16 April 2019 - 11:14 PM

View PostMuzafar, on 25 February 2009 - 03:16 AM, said:

When you are opening a form from another MID Child form you need to open it as follows:-

For example the form to be opened is named childForm, it will be opened as follows:-

childForm cf= new childForm();
cf.MdiParent = this.MdiParent; 
cf.Show();


Hope that helps ...


This code in c# not in VB.net
Kindly help me out the problem to load one child form from another child form.
Was This Post Helpful? 0
  • +
  • -

#7 andrewsw   User is offline

  • quantum multiprover
  • member icon

Reputation: 6792
  • View blog
  • Posts: 28,050
  • Joined: 12-December 12

Re: Opening an MDI Child Form from a Child Form

Posted 17 April 2019 - 03:22 AM

Searching "c# to vb.net" finds a range of online converters such as this one, yielding

Dim cf As childForm = New childForm
cf.MdiParent = Me.MdiParent
cf.Show

Was This Post Helpful? 0
  • +
  • -

#8 naveen2006   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-April 19

Re: Opening an MDI Child Form from a Child Form

Posted 17 April 2019 - 04:21 AM

View Postandrewsw, on 17 April 2019 - 03:22 AM, said:

Searching "c# to vb.net" finds a range of online converters such as this one, yielding

Dim cf As childForm = New childForm
cf.MdiParent = Me.MdiParent
cf.Show


this code is already being used but it can't work because some data is also loaded from one child form to another child form and also from database. the form displayed the content if i don't show as mdi child but when i show the form as child form then form not shown.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1