Skip to content

Instantly share code, notes, and snippets.

@mgravell
Created June 27, 2017 11:27
Show Gist options
  • Save mgravell/5adedecf35db44582ae51599dc9da727 to your computer and use it in GitHub Desktop.
Save mgravell/5adedecf35db44582ae51599dc9da727 to your computer and use it in GitHub Desktop.
thread exiting cleanly
[STAThread]
static void Main()
{
new Thread(() =>
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Console.WriteLine("running form");
Application.Run(new Form1());
Console.WriteLine("thread exited");
}).Start();
Console.WriteLine("Running app on another thread");
Console.ReadLine();
Console.WriteLine("exiting");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment