tags:

views:

70

answers:

1

How do I prevent multiple form opens

FormTanımlama frmTanimlama = new FormTanımlama();
FormRapor frmRapor = new FormRapor();

frmTanimlama.Close();
frmRapor.Close();

FormIslem frmIslem = new FormIslem();
frmIslem.MdiParent = this;
frmIslem.Show(); 

Other forms doesn't close When I open a new form

+2  A: 

You are going to need to give more details to get a more detailed answer.

But the simple answer is, your program should have an understanding of how your program functions. You will need to make some form of flag or structure that keeps track of what you have open so you can decide if other forms can be opened. You should be doing this check before the new Form() call so that you don't do all the initialization steps of the form when you are going to just reject it and not retain a reference to it.

unholysampler
FormTanımlama frmTanimlama = new FormTanımlama(); FormRapor frmRapor = new FormRapor(); frmTanimlama.Close(); frmRapor.Close(); FormIslem frmIslem = new FormIslem(); frmIslem.MdiParent = this; frmIslem.Show();other forms doesn't closeWhen I open a new form
Edit your question and use code formatting if you are going to add more details. Also, that code only ever shows one form and calls close on the others without them ever being shown.
unholysampler
+1 for "your program should have an understanding of how your program functions"
MPelletier