private UserControl CreatePanel(string panelName)
{
if (panelName != string.Empty)
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
foreach (Type type in executingAssembly.GetTypes())
{
if (type.Name.EndsWith(panelName))
{
UserControl panel = Activator.CreateInstance(type) as UserControl;
return panel;
}
}
}
return null;
}