how to not open a windows from if already a form is opened? different ways

Posted by Kotra_subba under C# on 3/19/2010 | Views : 2879 | Status : [Member] | Replies : 3
Can any one Please help on this above Question in .net windows application.

I hope I will get my result as sonn as possible.




Responses

Posted by: Kumarsudu on: 3/19/2010 [Member] Starter

Up
0
Down
Hi,

Please refer the below link

http://bytes.com/topic/c-sharp/answers/520198-check-if-form-already-open

Thanks and Regards,
Kumar

Kotra_subba, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Tripati.patro on: 2/18/2011 [Member] Starter | Points: 25

Up
0
Down
Tr y this code.

var form1 = new Form1();

var openedForm = Application.OpenForms[form1.Name];
if (openedForm != null)
{
openedForm.WindowState = FormWindowState.Normal;
openedForm.BringToFront();
openedForm.Activate();
}
else
{
// If required.
form1.MdiParent = MDIScreen;
form1.Show();
}


Hope this will solve your problem.

B.Tripati Patro
Oracle Certified Associate

Kotra_subba, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: riyait14-22208 on: 5/13/2013 [Member] Starter | Points: 25

Up
0
Down
thanx tripati!

Kotra_subba, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response