Re: Owner vs Parent vs ParentForm

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.

ContainerControl.ParentForm - is the Form that this ContainerControl is ultimately placed on, however the Parent of the ContainerControl maybe another ContainerControl, 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" <die.spammers@xxxxxxxxxx> wrote in message news:%23rWowSDmFHA.3380@xxxxxxxxxxxxxxxxxxxxxxx
| What's the difference in these three?



.



Relevant Pages

  • Re: Subclass a CRichEditCtrl, having trouble overriding OnNotify()
    ... The ON_NOTIFY_REFLECT_EX is useful if you want to extend the functionality transparently ... But I don't want to preclude the parent seeing this, ... or want total control. ... If you want to be transparent, or conditionally transparent, use ...
    (microsoft.public.vc.mfc)
  • Re: Listing objects
    ... Suppose we have a hierarchical class structure that looks something like ... parent' functionality. ... B's where more than one A could be the parent of a B. Eg ... Tees Close, Witham, Essex. ...
    (comp.lang.php)
  • Re: Cut, Copy and Paste?
    ... functionality no longer works. ... The Paste operation is something you want to make universal to all forms and ... Determining the active form and object can be done from the parent using ... The Clipboard.GetText will retrieve the contents of the Clipboard. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Submission of modal dialogs
    ... "Dale" wrote in message ... > pass variables from the parent to the dialog, ... wasn't a more efficient ".NET" way of achieving the same functionality... ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Getting components name from notification parameter?
    ... Parent or perhaps the Form they're on somehow, ... You can make the windowed control refer to the translation component ... inner component, it automatically goes away once the component has ... The Owner is passed from the TTranslator instance to the TWCMessage ...
    (alt.comp.lang.borland-delphi)