static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Window = new MainForm(); ThA = new Thread(() => { _cameraLogin = new CameraLogin(); //_cameraLogin.Show(); //_cameraHikvisionLogin.Check(toCheck); Application.Run(); } ); ThA.SetApartmentState(ApartmentState.STA); ThA.Start(); _websend = new WebSend(); Application.Run(Window); }