Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6743495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:58:03+00:00 2026-05-26T11:58:03+00:00

Is it possible for establish owner on new instance of forms?. While on Working

  • 0

Is it possible for establish owner on new instance of forms?. While on Working with main form and model windows this question arise in my mind that suppose if I create a new instance of Form1 as below:

//this Instance From main window
CashDeposit cd=new CashDeposit();
cd.Show(this);

Now I am going to close the same and trying to make the new instance of the same on new EventHandller of the CashDeposit as below:

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
 this.Close();
 CashDeposit cdd = new CashDeposit();
 cdd.Show();
}
//this would showing without any owner but if I create the new instance on another way  like below:        

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
 this.Close();
 CashDeposit cdd = new CashDeposit();
 cdd.Show(this);
}

//than obviously it will going to fire the error like not creating owner on disposing  object or control etc.

So It is hard for me to eastablish owner of new instance of CashDeposit from same class because the reference form is disposing and don’t know how to eastablish the new relation between both the main window form and CashDeposit from the Class of CashDeposit on new instance of the same.

Here the mainform is the owner of CashDeposit. And I am trying to eastablish owner on new instance of CashDeposit after the disposing the Old One(Relational) Form as above.

Any one have idea about how to achieve the same?.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:58:04+00:00Added an answer on May 26, 2026 at 11:58 am

    Here I asked the question about establish the Main Form as a Owner into CashDeposit Class on New Instance of the same at certain EventHandller It may be Button Or TextboxKeyPress.

    Look At Following Code:

    private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
    {
       this.Close();
       CashDeposit cdd = new CashDeposit();
       cdd.Show(this.Owner);
    }
    

    The above Code In CashDeposit Class Eastblished as a Owner of a self Instance where as I want to Eastablish the main form as a onwer of CashDeposit on New Instance Hence I am prefere to go with below code which solved the matters.

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
          this.Close();
          CashDeposit cdd = new CashDeposit();
          cdd.Show(MainForm.ActiveForm); //You can Replcae MainForm with your Orginal Form 
    
        }
    

    Now As per above I just added Form.ActiveForm Property which shows the owner of the activeform and handle the Main Windows Form and Model Window Forms very well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How do I calculate someone's age in C#? Maybe this could be
Is it possible to establish an SSL connection from a JavaScript? Or directly in
First off, I don't know if this is possible, but let me describe my
Is it possible to establish a set of templated function pointers, without the hassle
I am working on a function to establish the entropy of a distribution. It
Does someone know if it is possible to establish a backreference from within a
1) As far as I know, it is not possible to establish a SSL
as topic, I want establish VPN connection in iPhone app, if it possible? but
Is it possible to call Application.Run, but to not pass a form parameter, or
Is it possible to establish a communication with other application or languages using ports?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.