473,466 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

mdiParent problem

FormA is the mdiParent
FormB is the child
FormC is the Form that is used to open FormB

How do I open FormB from FormC (that is not a child) so that it it's
mdiParent is FormA?

Thanks,
--Ben
Nov 20 '05 #1
4 3104
Hi,

From FormC try something like that.

Dim frm as new FormB
frm.MdiParent = Me.MdiParent
frm.Show

Ken
------------------
"Ben dotNet" <Be*@myserver.com> wrote in message
news:%2*****************@TK2MSFTNGP10.phx.gbl...
FormA is the mdiParent
FormB is the child
FormC is the Form that is used to open FormB

How do I open FormB from FormC (that is not a child) so that it it's
mdiParent is FormA?

Thanks,
--Ben

Nov 20 '05 #2
Very good thinking, but my FormC is not a Child of any mdiParent. It's more
like a custom Open File Dialog Form (non-modal).

--Ben
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ea**************@TK2MSFTNGP12.phx.gbl...
Hi,

From FormC try something like that.

Dim frm as new FormB
frm.MdiParent = Me.MdiParent
frm.Show

Ken
------------------
"Ben dotNet" <Be*@myserver.com> wrote in message
news:%2*****************@TK2MSFTNGP10.phx.gbl...
FormA is the mdiParent
FormB is the child
FormC is the Form that is used to open FormB

How do I open FormB from FormC (that is not a child) so that it it's
mdiParent is FormA?

Thanks,
--Ben


Nov 20 '05 #3
* "Ken Tucker [MVP]" <vb***@bellsouth.net> scripsit:
From FormC try something like that.

Dim frm as new FormB
frm.MdiParent = Me.MdiParent
frm.Show


'FormC' is /not/ a child ;-).
How do I open FormB from FormC (that is not a child) so that it it's
mdiParent is FormA?


--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
Create a custom property on FormC that will contain the reference to the
parent (FormA). Modify the Constructor of FormC (New()) to take this value
as a parameter and set it. Then when you create FormB, set the parent to
that.
Example:

In FormC:
Sub New(ByRef MainParent as form)
me.ParentToSet = MainParent 'your custom property
End Sub

Sub OpenFormB()
Dim x as new FormB
x.mdiParent = me.ParentToSet
x.show()
Sub

or you can also modify FormB's constructor and pass the reference as a
parameter:

In FormB:
Sub New(ByRef MainParent as form)
me.mdiParent = MainParent
End Sub

In FormC
Sub OpenFormB()
Dim x as new FormB(me.ParentToSet)
x.show()
Sub

Good luck!

"Ben dotNet" <Be*@myserver.com> wrote in message
news:%2*****************@TK2MSFTNGP10.phx.gbl...
FormA is the mdiParent
FormB is the child
FormC is the Form that is used to open FormB

How do I open FormB from FormC (that is not a child) so that it it's
mdiParent is FormA?

Thanks,
--Ben

Nov 20 '05 #5

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

Similar topics

2
by: Terrance | last post by:
I'm hoping that there's someone out here that can help me with a coding problem. Here is the scenerio: I have a MdiParent Form on this MdiParent form there is a listview control and several text...
2
by: Terrance | last post by:
Good Day, I have a programming problem and need some help/advice. I have a MdiParent Form that has a tool bar with icons on it. I have a child form that needs set the toolbar enabled property to...
1
by: pei_world | last post by:
hi there, as I said, I have a MDIparent and childforms. Now I create a new class file which is not belong to childforms. My problem is how can I access to the MDIparent's public control(ie:a label...
2
by: Ron Pagliuca | last post by:
This code is supposed to pop-up a child window (frmConnector): Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click Dim...
26
by: Paul Mars | last post by:
FormParent load opens FormChildA. FormChildA btn click opens FormChildB. (FormChildA and FormChildB are both children of FormParent) (FormChildA and FormChildB are different forms) Problem:...
1
by: Roy | last post by:
Hi all, I'm opening a mdichild (Form2) within another mdichild (Form1). In Form1 I have: Form2.MdiParent = Me.MdiParent 'No problem here .... .... If Form2.ShowDialog = DialogResult.OK Then 'I...
1
by: PDP-8E | last post by:
I'm new to VB.Net 2003 - (2 weeks in) so this MAY be straightforward... (Things changed since Octal Assembler I see !!!) I'll try to lay this out in a way that makes sense I created a...
2
slashcanadian
by: slashcanadian | last post by:
Hi, I want to ask something about MDIParent and MDIChild. I have no problem by putting the Form inside MDIParent by giving the link in the MDIParent. My question is.. when I have a link to another...
0
by: kardiss | last post by:
I am trying to add Meebo's "Pop-out" kinda feature to my application which when a button is pressed in a MdiChild form, it kicks that MdiChild form out of the MdiParent boundary and acts like a SDI...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.