void _consult_ClassStateChanged(ConsultClassState state) { string text = String.Format("{0} [{1}]", this.Tag, state.ToString() ); HelperClass.BeginInvoke(this, delegate { Text = text; }); }
public void SetCurrentState(string text, int index, int?total) { HelperClass.BeginInvoke(this, delegate() { if (total != null) { progressBar.Maximum = (int)total; } progressBar.Value = index; this.Text = String.Format("{0} [{1}]", this.Tag, text ); this.Refresh(); //Application.DoEvents(); //SetCurrentState(text); }); }