C# 反射
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
Type[] types = assembly.GetTypes();
types得到当前程序集下所有的类
Type formType = (Type)((SourceGrid.Cells.Cell)cellContext.Cell).Tag;//将object类型强制转换为指定的类型
Form form = (Form)System.Activator.CreateInstance(formType);创建指定类型的实例
form.Owner = this;
form.Show();

浙公网安备 33010602011771号