public static Control GetControl(Type type, string name)
{
foreach (Control control in NWN2Toolset.NWN2ToolsetMainForm.App.Controls)
{
if (control.GetType() == type && control.Name == name)
return control;
}
throw new Exception(String.Format("Could not find Control of type {0} and name {1}.", type.ToString(), name));
}