///
/// 限制子窗体的个数
///
///
///
private bool showChildrenForm(string p_ChildrenFormName)
{
int i;
//依次检测当前窗体的子窗体
for (i = 0; i < this.MdiChildren.Length; i++)
{
//判断当前子窗体的name属性值是否与传入的字符串值相同
if (this.MdiChildren[i].Name == p_ChildrenFormName)
{
//此子窗体是目标子窗体,激活之
this.MdiChildren[i].Activate();
return true;
}
}
return false;
}
//子窗体的名称
"DjRjForm"
if (!showChildrenForm("DjRjForm"))
{
DjRjForm djrj = new DjRjForm();
djrj.MdiParent = this;
djrj.Show();
}
阅读(1635) | 评论(0) | 转发(0) |