How to instantiate a form while the main form is still responding

I am using .Net Framework 4.0 and C #. I want to dynamically create a form in my code, while the main form remains responsive. Creates a new thread and invokes the Application.Run(newForm)only way to do this? It just looks like a mess for such a simple thing. I thought this should be so common that there should be some kind of built-in functionality for this framework.

+3
source share
1 answer

You do not need another thread to create a new form and do not call a Application.Runsecond time. As long as you don't do anything that blocks the user interface (and you should never), both forms will work fine.

MyForm form = new MyForm();
form.Show();

ShowDialog Show , .

+4

All Articles