Finaly I solved my problem, my code was correct, just Hide old controls to show new ones, using this nice function :
private void SetControlPropertyValue(Control oControl, string propName, object propValue)
{
if (oControl.InvokeRequired)
{
SetControlValueCallback d = new SetControlValueCallback(SetControlPropertyValue);
oControl.Invoke(d, new object[] { oControl, propName, propValue });
}
else
{
Type t = oControl.GetType();
PropertyInfo[] props = t.GetProperties();
foreach (PropertyInfo p in props)
{
if (p.Name.ToUpper() == propName.ToUpper())
{
p.SetValue(oControl, propValue, null);
}
}
}
}
like this :
foreach (Control item in panel1.Controls.OfType<Type>())
{
SetControlPropertyValue(item, "Visible", false);
}
and then, I can recreate my controls like this:
AddControlToPanel(panel1, ctrl);
Thanks all for help :)