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
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

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

Nov 21 '05 #11
Good enough. Thanks


Cor Ligthert [MVP] wrote:

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

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


Nov 21 '05 #12
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

"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
| > 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
| > | > 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
| > | > applications...
| > | >
| > | > Control.Parent - Is the immediate control that this control is
| > on.
| > | > For example an option button placed in a Panel or GroupBox would
| > that
| > | > Panel or GroupBox as its Parent.
| > | >
| > | > ContainerContro l.ParentForm - is the Form that this ContainerContro l
| > | > ultimately placed on, however the Parent of the ContainerContro l
| > | > another ContainerContro l, which may have another Control as its
| > | > which may then be a Form. Basically this does a Control.Parent until
| > | > 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

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
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
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;
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(...."
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".
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...
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
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...
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.
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,...
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...
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,...
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...
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();...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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: 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.