Hi,
I've got this child form that when i try to check it in main form if (chldfrm.ShowDialog() == DialogResult.OK, and if true the child form is shown again. Though the passed value from child form into the main form is shown after the child form appears. Can any one help?
Thanks in advance.
Mark Christian BalilingPosted Apr 16, 2008, 9:00 AM
James,
Your code works, however it took me a couple of minutes how to work it out.
Thanks!
Niradhip ChakrabortyPosted Apr 15, 2008, 6:12 PM
Try this out. The following code will prevent you to open duplicate form.
foreach (Form frmchild in this.MdiChildren)
{
if (frmcompany is chldfrm)
{
frmchild.Show();
frmchild.Focus();
return;
}
}
chldfrm frmchild1 = new chldfrm();
this.AddOwnedForm(frmchild1);
frmchild1.MdiParent = this;
frmchild1.Show();
Niradhip ChakrabortyPosted Apr 15, 2008, 5:45 PM