Form msg = new Form(); Task.Run(new Action(() => { Thread.Sleep(4000); Invoke(new Action(() => { msg.Close(); })); })); MessageBox.Show(msg,ex.Message);