private void ThreadLockApp() { Thread th = new Thread(new ThreadStart(ThreadLockAppEx)); th.IsBackground = true; th.Start(); } public delegate void deleLockApp(); private void ThreadLockAppEx() { deleLockApp dele = new deleLockApp(LockApp); this.Invoke(dele); } private void LockApp() { Form3 formAppExit = new Form3(); formAppExit.ShowDialog(); }