private void SetStatus(string message, bool AllCompleted = false) { this.Invoke(new Action(() => { lbstatus.Text = string.Format("User: '******' => Action: '{1}' => Status: '{2}'", CurrentRunUser.UserName, Action.ToString(), message); })); if (AllCompleted) { new System.Threading.Thread(new System.Threading.ThreadStart(() => { int totalSecondLeft = 10; while (totalSecondLeft-- > 0) { this.Invoke(new Action(() => { lbstatus.Text = string.Format("The website will be close in {0}", totalSecondLeft); })); } this.Invoke(new Action(() => { this.Close(); })); })).Start(); } }