2011年8月13日

C# Winform 防止MDI子窗体重复打开

摘要: 下面代码是防止MDI子窗体多次实例化。//防止打开多个窗体 private bool ShowChildrenForm(string p_ChildrenFormText) { int i; //依次检测当前窗体的子窗体 for (i = 0; i < this.MdiChildren.Length; i++) { //判断当前子窗体的Text属性值是否与传入的字符串值相同 if (this.MdiChildren[i].Text == p_ChildrenFormText) { //如果值相同则表示此子窗体为想要调用的子窗体,激活此子窗体并返回true值 this.MdiChildre 阅读全文

posted @ 2011-08-13 23:59 空白画映 阅读(1822) 评论(0) 推荐(0)

导航