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

  • SEARCH
  • Home
  • 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 9005257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:05:43+00:00 2026-06-16T01:05:43+00:00

Is het possible to have one instance of a usercontrol running on two different

  • 0

Is het possible to have one instance of a usercontrol running on two different forms?


I did the following and it did not work (the controls only shows up at the last form).

static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var control = new UserControl1();

            var form2 = new Form2();
            form2.UserControl1 = control;
            form2.Show();

            var form1 = new Form1();
            form1.UserControl1 = control;

            Application.Run(form1);
        }
  • 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-06-16T01:05:44+00:00Added an answer on June 16, 2026 at 1:05 am

    I would have to say no. At least under normal .Net operation. If I create a textbox and add it to form1, then add the same textbox instance to form2, the textbox in form1 literally moves to form2. Even if it worked, properties like location, parentform, etc. would be borked between the two forms.

    If you need to have common instance data, a class singleton might fit the bill.

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

Sidebar

Related Questions

I have to parse a string. It contains one or two numbers. It can
i would like to have two msg boxes yes/no. The first one for saving
I have a login form with the following code if ($does_user == 1)//Als het
I try to make a simple program that does the following: I have two
I have two forms on a single page. Actually they're seperated pages but the
I have a post class and it kind of works, but there's one problem:
I have the following email code: <HTML> <BODY> <!--[if gte mso 7]><TABLE border=0 cellspacing=0
I following Ryan's subdomain railscast where het creates a Subdomain class used in his
<div class=poll> <h1>Poll</h1> <form name=pollvoteform1 method=post xxaction=/plugins/content_types/poll/poll.php> <p class=tekstaanmelden><b>Het regent </b></p> <input type=hidden name=poll
I need to create lines like this: <li data-target=c1.html><span>I. </span><span>Het tijdperk der goden</span></li> I

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.