I am still having problems with figuring out how to create winforms in a separate UI thread that I discussed here.
In trying to figure this out I wrote the following
On a new thread, call Application.Run passing the form object, this will make the thread run its own message loop while the window is open.
Then you can call .Join on that thread to make your main thread wait until the UI thread has terminated, or use a similar trick to wait for that thread to complete.
Example:
public void StartUiThread()
{
using (Form1 _form = new Form1())
{
Application.Run(_form);
}
}