Re: Opening more windows forms

Dec 2 2008 9:33 AM
Well i have one main form which i run like an application.On that main form i have 3 buttons which are opening another 3 forms(instances of Form2 class) which are of the same class Form2.

So i have :

Form2 form1=new Form2();
Form2 form2=new Form2();
Form2 form3=new Form2();


all of 3 instances are opened on the button click event on the mainForm.

I also have 3 backgroundworkers which are collecting data and passing them to the instances of forms with set,get properties.One background worker is for one instance.

My problem is when I open one of the instances everything works fine the instance is updated and is drawn just fine.I can see that the background worker is passing data to the instance,BUT the problem is when i close it and try to open an another instance everything freezes.The visual studio doesn't report any error everything stops.The instance that i have tried to open is beeing opened but everything is grey.

I open a instance with :form1.Visible=true
form1.show()

and i hide it with;

form1.Visible=false;
form1.Hide();

Each instance is opened and closed like this but something is not working well!!!

One more thing that might be important is that every form is updated with an event when i finish gathering the informations for drawing!!!!

Help please!!!!


Answers (3)