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 9182933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:40:55+00:00 2026-06-17T18:40:55+00:00

I searched the internet for this but i couldn’t find how to do it

  • 0

I searched the internet for this but i couldn’t find how to do it with C#

What i am trying to do is make it so that when i click on my NewTab button, a new tab appears with the same controls that were on the first tab. I saw some information on how to add a UserControl to your form, but C# doesn’t have anything like that.

And for everyone who would say “Post your code”, i don’t have any, so don’t bother saying that, the only code i have is the code for the program and that wouldn’t help anyone.

  • 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-17T18:40:56+00:00Added an answer on June 17, 2026 at 6:40 pm

    EDIT

    I have rewritten my solution to use reflection.

    using System.Reflection;
    
    // your TabControl will be defined in your designer
    TabControl tc;
    // as will your original TabPage
    TabPage tpOld = tc.SelectedTab;
    
    TabPage tpNew = new TabPage();
    foreach(Control c in tpOld.Controls)
    {
        Control cNew = (Control) Activator.CreateInstance(c.GetType());
    
        PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(c);
    
        foreach (PropertyDescriptor entry in pdc)
        {
            object val = entry.GetValue(c);
            entry.SetValue(cNew, val);
        }
    
        // add control to new TabPage
        tpNew.Controls.Add(cNew);
    }
    
    tc.TabPages.Add(tpNew);
    

    Some information can be found here.
    http://www.codeproject.com/Articles/12976/How-to-Clone-Serialize-Copy-Paste-a-Windows-Forms

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

Sidebar

Related Questions

i really need some help on this. I searched the internet but couldn't find
I've searched the internet for this but couldn't find anything useable, I was just
I have searched the internet and the perforce help pages, but couldn't find a
Searched, but couldn't find a good answer. I have an ASP.NET application that I
I've searched the internet thoroughly but couldn't find a clear answer to the problem.
First; I've searched for this here and on the net, but couldn't find a
This really puzzled for hours, I searched all over the internet, but got no
I have searched the web and keep trying for 5 hours but I couldn't
I never used progress bar. Searched in internet but could not find something useful.
Thou it is simple, I have searched this around the internet and I couldn't

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.