473,889 Members | 1,656 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
12 27926
Tom,
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.

As Jay stated, forms inherits from controls, because of that you will see
all methods, events and properties from Control. That does not mean they are
usefull. There are which are complete unusable. By instance the
backgroundimage in a textbox.

I hope this gives some more ideas

Cor
Nov 21 '05 #11
Good enough. Thanks

Tom

Cor Ligthert [MVP] wrote:
Tom,

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.


As Jay stated, forms inherits from controls, because of that you will see
all methods, events and properties from Control. That does not mean they are
usefull. There are which are complete unusable. By instance the
backgroundimage in a textbox.

I hope this gives some more ideas

Cor

Nov 21 '05 #12
Tom,
As Cor & I stated. Form inherits from Control. Which means that Form has all
the properties & methods that Control has. This can be very useful,
especially when you use a Form as a Control, in which case you need those
properties. However when using a Form as a Form, then those properties may
or may not be that useful.

Hope this helps
Jay

"Tom W" <di**********@n ospam.com> wrote in message
news:uu******** ******@TK2MSFTN GP09.phx.gbl...
|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 #13

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

Similar topics

1
2160
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
11885
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
12293
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
2312
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
2105
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
3645
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
1793
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
3452
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
1925
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
9810
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
11203
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...
1
10896
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,...
1
7999
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
7151
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
5830
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
6029
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4650
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
3
3257
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.