473,804 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
+ 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 3120
Hi,

From FormC try something like that.

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

Ken
------------------
"Ben dotNet" <Be*@myserver.c om> wrote in message
news:%2******** *********@TK2MS FTNGP10.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***@bellsout h.net> wrote in message
news:ea******** ******@TK2MSFTN GP12.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.c om> wrote in message
news:%2******** *********@TK2MS FTNGP10.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***@bellsout h.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.Parent ToSet)
x.show()
Sub

Good luck!

"Ben dotNet" <Be*@myserver.c om> wrote in message
news:%2******** *********@TK2MS FTNGP10.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
1622
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 controls. This MdiParent form has a menu bar that gives the user the ability to open child forms. My problem is when the child form(s) are opend and if the user moves the child form over the listview contol or text controls the listview and text...
2
2693
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 FALSE. Currently, I have the following syntax in my main module when running the application: Public Sub Main() Dim frmSplash As SplashScreen Dim frmParent As ParentForm
1
2806
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 in parent form) object without create an instance of the parent form.
2
1877
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 p_frmConnector As New frmConnector() p_frmConnector.MdiParent = Me p_frmConnector.Show() End Sub
26
1962
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: FormChildA btn click can only open one instance for FormChildB. I need multiple instances of FormChildB. Any suggestions or ideas please.
1
2475
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 get an error message here. This is the error: Forms that are not top level forms cannot be displayed as modal dialog. Remove the form from any parent form before calling ShowDialog. When I remove:
1
1788
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 MdiParent form In that form I want Child forms to apear BASED ON BUTTON Control Click Event The Child needs to appear in the same location - Basically, turn ChildForm1
2
1192
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 Form in the First Form. The form will show, but outside the MDIParent. Can someone help me to solve this problem? Thank you
0
1656
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 form of itself. When a button is pressed again, it is kicked back into the parent form. Everything is working fine except one problem. When the MdiChild form is kicked back into the form, I have to click the title bar of each MdiChild form to...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10599
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10346
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10347
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10090
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6863
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5531
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.