I have created 2 windows form applications in a c# program. I did this:
Application.Run(new Form1());
Application.Run(new Form2());
The second form is not loading.Why? how can i resolve this problem? i would like to activate both these forms in the same time. Each of this form application loades a different method. I would like to somehow create a paralel process for each of these forms.
solution and problem:
i’ve created 2 threads – for the 2 forms. This forms call the parent form. The thing is that the parent form has a vector in which i would like to continuously add elements from the form. I’ve noticed that the vector is reinitialized every time the thread is reactivated. how to change this thing?
Because Application.Run is blocking. It’s running the application on the current thread. You’d have to start 2 separate threads with one of the Application.Run commands in each of them.
The best course of action would be to open one of the two in a separate thread.