/// <summary> /// Sets the title of the progress dialog /// </summary> /// <param name="title">The title.</param> public static void SetTitle(string title) { if (instance.InvokeRequired) //if another thread called this method { SetTitleCallback s = new SetTitleCallback(SetTitle); instance.Invoke(s, title); } else { instance.Text = title; } }
public void SetTitle(string text) { if (InvokeRequired) { SetTitleCallback d = new SetTitleCallback(SetTitle); this.Invoke(d, new object[] { text }); } else { Text = text; } }
// Allows setting the application title from seperate threads private void SetTitle(string s) { if (this.InvokeRequired) { SetTitleCallback d = new SetTitleCallback(SetTitle); this.Invoke(d, new object[] { s }); } else { this.Text = s; } }
public void SetTitle(string title, string subtitle) { // InvokeRequired required compares the thread ID of the calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.InvokeRequired || this.labelHead.InvokeRequired) { SetTitleCallback titleCallback = new SetTitleCallback(SetTitle); this.Invoke(titleCallback, new object[] { title, subtitle }); } else { this.Text = title; this.labelHead.Text = subtitle; } }