本文整理汇总了C#中System.Windows.Forms.ToolStrip.Invoke方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStrip.Invoke方法的具体用法?C# ToolStrip.Invoke怎么用?C# ToolStrip.Invoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolStrip
的用法示例。
在下文中一共展示了ToolStrip.Invoke方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetTextToolStripLabel
/// <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;
}
}
示例2: IncrementProgressBar
/// <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();
}
}
示例3: SetTextToolStripTextBox
/// <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;
}
}
示例4: SetProgressBarProperties
/// <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;
}
}