Hi all
I have two usercontrols A and B witch should share the same instance of the third usercontrol C.
c=
new Ccontrol();
a= new Acontrol();
b= new Bcontrol();
a.C = c;
b.C= c;
ok this is working Iam getting the same instanse in both A and B. (simple)
But the problem is when displaying the C control. it is only showing on either A or B control depends on the oreder I put the C control in. The A and B controls are notvisable bothat same time. So when I switch betweeen A and B the C control only shows on the control witch got the C last (above the b control)
The C control is in a Panel, and I use a propertie to set it on like so.
public C c
{
get{return c;}
set
{
this.panel.Controls.Remove(c);
//clean up
c.Dispose();
c= null;
c= value;
panel.Controls.Add(c);
}
}
I've tried to suspend the layout on all and on nothing in differrent orders, resulting in same problem.
so the problem is as follow, the Control C only displays on either A or B, But is still there under the hood.
Best regards..