How can I duplicate tabPage in c#?
I got it!
For those who has the same kind of problem, Here is what I’ve done:
I had created a UserControl (thanks a lot for @SLaks and @Brian for your tip), copied all objects from my TabControl to my new UserControl and used the follow code to create a dynamic tabs:
for (int x = 0; x < 3; x++)
{
UserControl1 uc = new UserControl1();
TabPage tp = new TabPage();
tp.Controls.Add(uc);
this.TabControl1.TabPages.Add(tp);
}
As Schabse mentioned in a comment above, I highly recommend that you do this with User Controls.