if I have one button on the form, and another form apprears after clicking the button, but if i keep clicking the button, the number of 2nd form would exist as many as I click.
so is there any way or property to make me no matter how many times I click, there is only one 2nd form.
The form2 variable should be a variable of form1. Only create a new form, if it is null. Else make the form2 visible.
Sorry, I didn't understand what you mean, can you make a simple example.
private Form2 f = null;
in button click event:
if( f == null )
f = new Form2();
Don't you think making Form2 modal would be better ? Do you actually need to keep both Windows open ?
Yes, I am using Modal, but if there are around 10 forms interacting each other, that would be a problem,
Thank you for your code.