Hierarchical relationship between parent window and child window

Source: Internet
Author: User

Suppose there are two forms: Rootwindow,subwindow, which raises an event in Rootwindow and displays Subwindow

1, if a pop-up form (such as Subwindow) simply calls the show method and does not set its Owner property:

Classrootwindow
{
void Foo ()
{
Subwindow sw = Newsubwindow ();
Sw.    Show ();
}
}

The pop-up form (Subwindow) and the source form (such as Rootwindow) do not have any hierarchical relationships, that is, they are not rendered in a modal manner (Subwindow does not block the user's action against Rootwindow). Subwindow in show out in the top of the Rootwindow, but the user can click through the mouse and other ways will rootwindow to Subwindow front to cover the Rootwindow content, that is, the user focus of the window will be brought to the forefront. And the minimization of Rootwindow and Subwindow does not affect the restore operation.

2, if a pop-up form (such as Subwindow) calls the Show method and sets its Owner property:

Classrootwindow
{
void Foo ()
{
Subwindow sw = Newsubwindow ();
Sw.            Owner = this;
Sw.    Show ();
}
}

Then the pop-up form (Subwindow) and the source form (such as Rootwindow) will have a parent-child relationship. That is, the pop-up form will always be above the source form, but it is not modal, the user can manipulate the source form, and when the source form is minimized or restored, the pop-up form will also be minimized and restored. The contrary is not tenable.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.