473,769 Members | 4,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Owner vs Parent vs ParentForm

What's the difference in these three?
Nov 21 '05 #1
12 27883
Tom,
| What's the difference in these three?
| Owner vs Parent vs ParentForm

Form.Owner - Is the Form that "owns" this form. For example a modless
Find/Replace dialog would be Owned by Notepad's main window. If you minimize
the main Form, the owned form will minimize, if you restore the main form,
the owned form will restore... Normally used for "tool" windows in SDI
applications...

Control.Parent - Is the immediate control that this control is placed on.
For example an option button placed in a Panel or GroupBox would have that
Panel or GroupBox as its Parent.

ContainerContro l.ParentForm - is the Form that this ContainerContro l is
ultimately placed on, however the Parent of the ContainerContro l maybe
another ContainerContro l, which may have another Control as its Parent,
which may then be a Form. Basically this does a Control.Parent until it
finds a type that inherits from Form.

Hope this helps
Jay

"Tom W" <di**********@n ospam.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
| What's the difference in these three?
Nov 21 '05 #2
Tom,

dim frm as myform
frm.owner = me

In the myform you can say
me.owner.textbo x1 or whatever

me.ismidicontai ner = true
frm.parent = me
me contains a than a colection of zero or more childs in its
mdichildscollec tion

me.parentform.m enu1 'in a mdi form a menu on the mdicontainer

I hope this helps,

Cor
"Tom W" <di**********@n ospam.com> schreef in bericht
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
What's the difference in these three?

Nov 21 '05 #3
Cor,
| me.ismidicontai ner = true
| frm.parent = me
| me contains a than a colection of zero or more childs in its
| mdichildscollec tion
Your example appears to be Form.MdiParent and not Control.Parent.

Hope this helps
Jay

"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:e3******** ******@TK2MSFTN GP12.phx.gbl...
| Tom,
|
| dim frm as myform
| frm.owner = me
|
| In the myform you can say
| me.owner.textbo x1 or whatever
|
| me.ismidicontai ner = true
| frm.parent = me
| me contains a than a colection of zero or more childs in its
| mdichildscollec tion
|
| me.parentform.m enu1 'in a mdi form a menu on the mdicontainer
|
| I hope this helps,
|
| Cor
|
|
| "Tom W" <di**********@n ospam.com> schreef in bericht
| news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
| > What's the difference in these three?
|
|
Nov 21 '05 #4
Sorry,

I see I was answering with the parent a mdiparent.

:-(

Cor
Nov 21 '05 #5
Jay,

I saw it, I posted my correction before I saw this message

Cor
Nov 21 '05 #6
Jay,

I forgot,

Thanks anyhow

Cor
Nov 21 '05 #7
OK great, owner provides functionality that ties forms togther when
minimizing and maximizing. But you can reference Parent and ParentForm
from a form class. Can that just be used as another way to tie them
together that doesn't provide any functionality?

Tom

Jay B. Harlow [MVP - Outlook] wrote:
Tom,
| What's the difference in these three?
| Owner vs Parent vs ParentForm

Form.Owner - Is the Form that "owns" this form. For example a modless
Find/Replace dialog would be Owned by Notepad's main window. If you minimize
the main Form, the owned form will minimize, if you restore the main form,
the owned form will restore... Normally used for "tool" windows in SDI
applications...

Control.Parent - Is the immediate control that this control is placed on.
For example an option button placed in a Panel or GroupBox would have that
Panel or GroupBox as its Parent.

ContainerContro l.ParentForm - is the Form that this ContainerContro l is
ultimately placed on, however the Parent of the ContainerContro l maybe
another ContainerContro l, which may have another Control as its Parent,
which may then be a Form. Basically this does a Control.Parent until it
finds a type that inherits from Form.

Hope this helps
Jay

"Tom W" <di**********@n ospam.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
| What's the difference in these three?

Nov 21 '05 #8
Tom,
Parent is a Control to Control relationship.

ParentForm is a Control to Form relationship.

I really don't see how you would see a Form to Form relationship in either
Parent or ParentForm, unless you placed one Form as Child *Control* of a
second Form. Then however your "Form" is no longer a Form, but its now a
Control!

What specifically do you have in mind?

Hope this helps
Jay

"Tom W" <di**********@n ospam.com> wrote in message
news:uz******** ******@TK2MSFTN GP09.phx.gbl...
| OK great, owner provides functionality that ties forms togther when
| minimizing and maximizing. But you can reference Parent and ParentForm
| from a form class. Can that just be used as another way to tie them
| together that doesn't provide any functionality?
|
| Tom
|
| Jay B. Harlow [MVP - Outlook] wrote:
| > Tom,
| > | What's the difference in these three?
| > | Owner vs Parent vs ParentForm
| >
| > Form.Owner - Is the Form that "owns" this form. For example a modless
| > Find/Replace dialog would be Owned by Notepad's main window. If you
minimize
| > the main Form, the owned form will minimize, if you restore the main
form,
| > the owned form will restore... Normally used for "tool" windows in SDI
| > applications...
| >
| > Control.Parent - Is the immediate control that this control is placed
on.
| > For example an option button placed in a Panel or GroupBox would have
that
| > Panel or GroupBox as its Parent.
| >
| > ContainerContro l.ParentForm - is the Form that this ContainerContro l is
| > ultimately placed on, however the Parent of the ContainerContro l maybe
| > another ContainerContro l, which may have another Control as its Parent,
| > which may then be a Form. Basically this does a Control.Parent until it
| > finds a type that inherits from Form.
| >
| > Hope this helps
| > Jay
| >
| > "Tom W" <di**********@n ospam.com> wrote in message
| > news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
| > | What's the difference in these three?
| >
| >
Nov 21 '05 #9
I don't have anything specific in mind beyond what Owner offers, but I
didn't understand why Parent and ParentForm were available on the form
class.

Jay B. Harlow [MVP - Outlook] wrote:
Tom,
Parent is a Control to Control relationship.

ParentForm is a Control to Form relationship.

I really don't see how you would see a Form to Form relationship in either
Parent or ParentForm, unless you placed one Form as Child *Control* of a
second Form. Then however your "Form" is no longer a Form, but its now a
Control!

What specifically do you have in mind?

Hope this helps
Jay

"Tom W" <di**********@n ospam.com> wrote in message
news:uz******** ******@TK2MSFTN GP09.phx.gbl...
| OK great, owner provides functionality that ties forms togther when
| minimizing and maximizing. But you can reference Parent and ParentForm
| from a form class. Can that just be used as another way to tie them
| together that doesn't provide any functionality?
|
| Tom
|
| Jay B. Harlow [MVP - Outlook] wrote:
| > Tom,
| > | What's the difference in these three?
| > | Owner vs Parent vs ParentForm
| >
| > Form.Owner - Is the Form that "owns" this form. For example a modless
| > Find/Replace dialog would be Owned by Notepad's main window. If you
minimize
| > the main Form, the owned form will minimize, if you restore the main
form,
| > the owned form will restore... Normally used for "tool" windows in SDI
| > applications...
| >
| > Control.Parent - Is the immediate control that this control is placed
on.
| > For example an option button placed in a Panel or GroupBox would have
that
| > Panel or GroupBox as its Parent.
| >
| > ContainerContro l.ParentForm - is the Form that this ContainerContro l is
| > ultimately placed on, however the Parent of the ContainerContro l maybe
| > another ContainerContro l, which may have another Control as its Parent,
| > which may then be a Form. Basically this does a Control.Parent until it
| > finds a type that inherits from Form.
| >
| > Hope this helps
| > Jay
| >
| > "Tom W" <di**********@n ospam.com> wrote in message
| > news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
| > | What's the difference in these three?
| >
| >

Nov 21 '05 #10

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

Similar topics

1
2153
by: POnfri | last post by:
Hi I'm having trouble setting the main form visible from within the child form. I have set the main form to hide (SignatureMain.Hide()) I then load the child form from within a button on form1 Treatment.ShowDialog() On the child form Treatment i try to do the following in an Exit button
3
11878
by: David N | last post by:
Hi All, I just wonder if in C#, I can develop a user defined control that can call its parent function which is not yet developed. For example, how do I make my user control call a to-be-developed-function cmdOkay_Click() function as described below. 1. Create an user control that contains an OK button as below Public Class MyButton:System.Windows.Form.UserControl
4
12285
by: Jason Huang | last post by:
Hi, In my ASP.Net C# Windows Form project, I have 2 forms, FormParent and FormChild. I have a Button1_Click event in FormParent, and the codes are: private void Button1_Click(object sender, System.EventArgs e) { FormChild MyFormChild=new FormChild(); MyFormChild.ParentForm=this;
4
2309
by: Kenneth | last post by:
Hi, I have two forms, parentForm and childForm. parentForm has a button(btn1) and a grid. childForm has a couple of textboxes and a button. The button on parentForm opens a new window of childForm: btn1.Attributes("onclick")="javascript window.open(...."
37
2088
by: Geoff Jones | last post by:
Hi Suppose I have two forms: Form1 and Form2. I create and show an instance of Form2 in the code of Form1 e.g. Dim myForm2 = New Form2 myForm2.Show() How do I tell myForm2 that Form1 is its parent? That is, when I look at either "Parent" or "ParentForm" in Form2, they both show "Nothing".
4
3640
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 possible.. for example..i hav a menu in the parent form named "Administrator" whic has an item "mnuLogIn"..now when i click on login..another child form named "frmLogIn" is displayed..what i want to happen is this: when login form(frmLogIn) is...
1
1785
by: Vishal Sethia | last post by:
Just trying to understand the behaviour of spawn. Consider I have a function which creates two threads. And in one of the threads I make a call to pexpect.spawn. spawn would fork and create a new new child In this case who becomes the owner of this child process. Is it the thread that spawned becomes the owner or is the main program becomes the owner of that child process. Thanks, -V
0
3449
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi, i created this user control, which has the ability to open forms. However these forms are to be opened as MDI Children and i am passing the form object which contains this usercontrol, so that its parent which is the MDI Form will be assigned to any of the forms opened by this control. So i was passing it using the constructor,, and to make it behave properly in VS i had to get into the designer.cs in the VS generated code and change...
3
1915
by: eBob.com | last post by:
How does a "sub-form", i.e. one invoked by another form, determine anything about the form which brought it into existence, i.e., I suppose, instantiated it? I wanted to so something like this ... MsgBox("called by " & Owner.Name) .... but that throws a null reference exception. Parent.Name and ParentForm.Name also throw null reference exceptions. Form1.Name works - but that's not very flexible.
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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
10211
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
10045
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...
0
9863
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...
1
7409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5299
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...
1
3959
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
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.