I have a UserControl that has in it a TableLayoutPanel. I activate ControlAdded event that adds the controls added in the UserControl to the TableLayoutPanel:
private void UserControl1_ControlAdded(object sender, ControlEventArgs e)
{
tableLayoutPanel1.Controls.Add(e.Control);
}
The problem is that at DesignTime when I'm trying to add a control to my new UserControl, the VisualStudio 2005 crashes.
If I have another UserCOntrol that inherits from it i get this error: 'child' is not a child control of this parent
Can anyone give me some sample code that solves this problem?
Thanks