反射动态调用WinForm窗口

代码如下:
Assembly assembly  =  System.Reflection.Assembly.GetExecutingAssembly();
Type type 
=  assembly.GetType( " CoalTraffic.Report. "   +  strReportArea  +   " LoadWeightPrint " );
object  obj  =  Activator.CreateInstance(type, strWeightCode, true ); Form formToShow  =  (Form)obj; formToShow.ShowDialog();

你可能感兴趣的:(WinForm)