/// <summary> /// Set text value of a tool strip label. /// </summary> /// <param name="toolStripName"></param> /// <param name="labelName"></param> /// <param name="text"></param> public static void SetTextToolStripLabel(ToolStrip toolStripName, ToolStripLabel labelName, string text) { if (toolStripName.InvokeRequired) { toolStripName.Invoke((System.Action)(() => { labelName.Text = text; })); } else { labelName.Text = text; } }
/// <summary> /// Increment progress bar. /// </summary> /// <param name="toolStripName"></param> /// <param name="controlName"></param> public static void IncrementProgressBar(ToolStrip toolStripName, ToolStripProgressBar controlName) { if (toolStripName.InvokeRequired) { toolStripName.Invoke((System.Action)(() => { controlName.PerformStep(); })); } else { controlName.PerformStep(); } }
/// <summary> /// Set text value of a tool strip text box. /// </summary> /// <param name="toolStripName"></param> /// <param name="textBoxName"></param> /// <param name="text"></param> public static void SetTextToolStripTextBox(ToolStrip toolStripName, ToolStripTextBox textBoxName, string text) { if (toolStripName.InvokeRequired) { toolStripName.Invoke((System.Action)(() => { textBoxName.Text = text; })); } else { textBoxName.Text = text; } }
/// <summary> /// Set progress bar properties. /// </summary> /// <param name="toolStripName"></param> /// <param name="controlName"></param> /// <param name="minValue"></param> /// <param name="maxValue"></param> /// <param name="stepSize"></param> public static void SetProgressBarProperties(ToolStrip toolStripName, ToolStripProgressBar controlName, int minValue, int maxValue, int stepSize) { if (toolStripName.InvokeRequired) { toolStripName.Invoke((System.Action)(() => { controlName.Value = minValue; controlName.Minimum = minValue; controlName.Maximum = maxValue; controlName.Step = stepSize; })); } else { controlName.Value = minValue; controlName.Minimum = minValue; controlName.Maximum = maxValue; controlName.Step = stepSize; } }