Click here to Skip to main content
16,010,673 members

Comments by Pankaj Bhandari08 (Top 2 by date)

Pankaj Bhandari08 16-Feb-15 1:36am View    
I am assuming that you have some MDI from where you are opening the form1,
Create object of form2 on the MDI.

Form2 objForm2 = null;

now on the button click of the form1, first check for if objForm2 is null or not .

if(objForm2 == null)
{
//Create the form2 object and show it.
Form2 objForm2 = new Form2();
}
if(!objForm2.Visible)
{
//we have the form but visiblity is hidden
objForm2.Visible = true
}
Pankaj Bhandari08 16-Feb-15 1:09am View    
so you want like only one instance of form2 should be open?