标签:winform style blog ar color sp for on div
反射通过命名空间.窗体名称,调用窗体
public void OpenChildForm(string formName) { Type t = Type.GetType(formName); Assembly asm = Assembly.GetExecutingAssembly(); DockContent frm = asm.CreateInstance(formName) as DockContent; if (frm != null) { frm.Show(this.dockPanelMain); } }
重复打开窗体监测
public bool CheckFormIsOpen(string formname) { bool remark = false; for (int a = 0; a < base.MdiChildren.Length; a++) { if (formname.Equals(base.MdiChildren[a].GetType().Namespace + "." + base.MdiChildren[a].GetType().Name)) { base.MdiChildren[a].Activate(); remark = true; } } return remark; }
C# WeifenLuo.WinFormsUI.Docking.dll 应用之问题集 反射动态调用winform窗体
标签:winform style blog ar color sp for on div
原文地址:http://www.cnblogs.com/24tt/p/4117456.html