473,320 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

MDI Parent/Child forms

This is what I have - Form1 is an MDI Container, form2 is an MDI Child
of form1, Form3 is a model form. What I want to be able to do is
activte form2 as a child of form1 from form3. The problem is that
form3 is not a child of form1 so I have no way of setting the mdiParent
property from form2. Does anyone know how to set the parent property
in this instance?
The other thing that would work is if you could have a model child
form, but .net doesn't seem to let you do this, or am I missing
something?

Thanks for your help,
Linda

Mar 15 '06 #1
2 3076
Linda,

You are correct that an mdi child form cannot be shown modally.

Here is one way to accomplish what you need:

The form to be shown modally needs a reference to the mdi container. So in
form3 add a property to reference the container:

Public mdiContainer As Form1

On the mdi container form, write code to show form3 modally:

Dim f As New Form3
f.mdiContainer = Me

f.ShowDialog()

On form3, write code to show form2 as an mdi child form:

Dim f As New Form2
f.MdiParent = Me.mdiContainer
f.Show()

Me.Close()
Kerry Moorman
"Linda U" wrote:
This is what I have - Form1 is an MDI Container, form2 is an MDI Child
of form1, Form3 is a model form. What I want to be able to do is
activte form2 as a child of form1 from form3. The problem is that
form3 is not a child of form1 so I have no way of setting the mdiParent
property from form2. Does anyone know how to set the parent property
in this instance?
The other thing that would work is if you could have a model child
form, but .net doesn't seem to let you do this, or am I missing
something?

Thanks for your help,
Linda

Mar 15 '06 #2
Thank you! This worked great.

Linda

Mar 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brindley | last post by:
Hi there, In my Mdi application, I have placed a set of controls on the parent form to call child forms. The problem is that the controls hide the child forms. I have used SendToBack when Im...
25
by: Steve Jorgensen | last post by:
Yup, Steve's full of tips, but hey, it makes him feel important, right? Ok, here goes. I've been trying to improve encapsulation by putting code in the same object as the stuff it affects, so I...
3
by: Maheshkumar.R | last post by:
Hi groups, How i can command over the MDI CHIlD forms created dynamically at runtime from PARENT. Let say, i have generated 5 mdichild forms, but i want to work with child form1 from MDI...
2
by: Jim Shank | last post by:
I am really trying to find the best OOP way of doing this. I have a parent MDI form with multiple children and I am trying to communicate variables between them. I have been able to successfully...
6
by: Edwinah63 | last post by:
Hi everyone, could someone give me some thoughts on the best way to manage mdi parent and child forms? in vb6 i could scroll through the forms collection and determine which forms were...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
3
by: Eddie | last post by:
If FormMain = MDI parent, FormSub = Child parent, I execute FormSub from the menu like this way. FormSub^ sub = gcnew FormSub; sub->MdiParent = this; sub->Show(); This can generate child...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
2
by: Bob Johnson | last post by:
..NET 3.5: I have placed two controls at the top of an Mdi parent form. The top-most control is a Panel that is docked to the Top. Immediately below the Panel is a user control that is Anchored to...
1
by: nupuragr82 | last post by:
I have a parent form and on button click I am calling a child page where i have a textbox and a button. On button click of child form I am passing the value of the Textbox to the Textbox in parent...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.