inside your MDI form (which has its IsMdiContainer = true;), try something likeAssembly downloadedAssembly;
Type formType;
Form downloadedForm;try
{
//download and load the assembly
downloadedAssembly =
Assembly.LoadFrom("YourOtherFormDLLPath.dll");
// find the type in the assembly for the object we want to create
formType = downloadedAssembly.GetType("YourFormClassName");
//Create an instance of the desired type and show it
downloadedForm = (Form) System.Activator.CreateInstance(formType);
if (downloadedForm != null)
{
downloadedForm.MdiParent = this;
downloadedForm.Show();
}
}
catch (Exception exc)
{
MessageBox.Show(exc.ToString());
}
Type formType;
Form downloadedForm;try
{
//download and load the assembly
downloadedAssembly =
Assembly.LoadFrom("YourOtherFormDLLPath.dll");
// find the type in the assembly for the object we want to create
formType = downloadedAssembly.GetType("YourFormClassName");
//Create an instance of the desired type and show it
downloadedForm = (Form) System.Activator.CreateInstance(formType);
if (downloadedForm != null)
{
downloadedForm.MdiParent = this;
downloadedForm.Show();
}
}
catch (Exception exc)
{
MessageBox.Show(exc.ToString());
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货