Copy an object reference..?
In theory..I'd like to do the following..copy object a's properties over to object b, then be able to modify b's properties without affecting object a. I'm just using a Panel for the example, basically I'd like to do this with any class..
Code:
Panel a = new Panel(x);
a.Tag = 0;
//Real code
Panel a = a;
//Theory code (wrong syntax but is there a way to do this?)
Panel b = new b;
b.Tag = 1;
int ia = (int) a.Tag;
int ib = (int) b.Tag;
//real output ia = 0
//real output ib = 0
//theory output ia = 0
//theory output ib = 1
Specifically I have a TabControl and I want to define a Tab Page and whats on it, but I'd like to be able to copy the tab page and create a new one so it has the same design/controls on it.
I'm sure I can't have the same exact control on the form at the same time so I could do Form.Controls.Remove for one then add the other? Or maybe I'm going the wrong way on this...
Thanks,
Mitchel