|
-
Mar 8th, 2004, 02:22 AM
#1
Thread Starter
Junior Member
mdi form problem
Code:
private void btnReg_Click(object sender, System.EventArgs e)
{
bool FrmIsOpen = false;
if(this.MdiParent != null && this.MdiParent.MdiChildren != null)
{
for (int i=0; i < this.MdiParent.MdiChildren.Length; i++)
{
if (this.MdiParent.MdiChildren[i].GetType() == typeof(FrmPassword))
{
FrmIsOpen = true;
break;
}
}
}
if (!FrmIsOpen)
{
FrmPassword r = new FrmPassword();
r.MdiParent = this;
r.Show();
}
/*FrmPassword r = new FrmPassword();
r.MdiParent= this;
r.Show();*/
}
i have this code here that checks whether a frm is already opened or not, if its not opened, it opens one, and if its already opened it'll show the one thats already opened and not a new one...all seems to be fine....but i still get the same form opening twice...whats wrong?
-
Mar 8th, 2004, 07:45 PM
#2
Sleep mode
Code:
private void btnReg_Click(object sender, System.EventArgs e)
{
bool FrmIsOpen = false;
if(this.MdiParent != null && this.MdiParent.MdiChildren != null)
{
for (int i=0; i < this.MdiParent.MdiChildren.Length; i++)
{
if (this.MdiParent.MdiChildren[i].GetType() == typeof(FrmPassword))
{
FrmIsOpen = true;
break;
}
}
}
if (!FrmIsOpen)
{
FrmPassword r = new FrmPassword();
r.MdiParent = this;
r.Show();
} else {
/*FrmPassword r = new FrmPassword();
r.MdiParent= this;
r.Show();*/
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|