I have hard-coded a tabcontrol, which loads a bunch of data for me to use, but I want to be able to throw the tabcontrol away and recreate the same one that I hard-coded, but blank without any input.
Right now I have a simple tabControl with about 10-15 pages and about 10 controls on each which vary from TextBoxes to all kinds of controls.
I've tried doing it simple and just removing and recreating the control with 2 simple lines like:
this.Controls.Remove(tabControl1);
this.Controls.Add(tabControl1);
Which works fine with removing and recreating the tabControl but it doesn't recreate the controls inside returning the value to the originals.
I have a working version which just removes the tabControl and resets every child control to custom value but this seems a but to ugly and hacked for what I'm looking for.
Is there some way or creating a template of the tabControl and call a new one every time?