An error occurred while using the showdialog method. As a result, the owner form passed is null ).

Source: Internet
Author: User
1. Field description:

My main interface is mdicontainer (FA ),
Click a menu to open a showdialog form (FB): FB. showdialog ();
After running FB, another new form (FC) is opened and FB is disabled,
It is required that FC be a sub-form of FA after running.

So I have to pass FA to FC through FB: fc. mdiparent = FB. parentform;
However, FB. parentform is always null, and later I found that there is another property owner,
So FC. mdiparent = FB. owner; traceProgramStill blank, depressing ~~~~
Can't you solve this problem? But does the SQL Server 2000 query analyzer do ~~!!

2. Turning Point:

The last thing I know is that my showdialog method is incorrect!
In fact, there is another overload method for showdialog !!

Form. showdialog method (iwin32window)
Display the form as a mode dialog box with the specified owner.
ParametersOwner:
Any object that implements iwin32window (indicating that the top-level window of the mode dialog box will be available.

3. Result:

RewriteCodeFB. showdialog (FA );
FC. mdiparent = FB. owner;
Finally run successfully. After interface B is closed, interface C becomes a subinterface of interface.

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.