static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mainForm mf = new mainForm(); Application.ThreadException += new ThreadExceptionEventHandler(mf.UnhandledThreadExceptionHandler); Application.Run(mf); }