Hi Tom,
Check the code below. It will clone any control.
private void CloneControl(Control originalCtrl, Control newCtrl)
{
PropertyDescriptorCollection origProps =
TypeDescriptor.GetProperties(originalCtrl);
PropertyDescriptorCollection newProps =
TypeDescriptor.GetProperties(newCtrl);
foreach (PropertyDescriptor desc in origProps)
{
if ((desc != null) && (desc.ShouldSerializeValue(originalCtrl)))
{
try
{
newProps[desc.Name].SetValue(newCtrl,
desc.GetValue(originalCtrl));
}
catch { }
}
}
}
hope this helps
Fitim Skenderi