本文整理汇总了C#中System.Windows.Forms.Button.BeginInvoke方法的典型用法代码示例。如果您正苦于以下问题:C# Button.BeginInvoke方法的具体用法?C# Button.BeginInvoke怎么用?C# Button.BeginInvoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Button
的用法示例。
在下文中一共展示了Button.BeginInvoke方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetButtonState
public void SetButtonState(Button anything, bool state)
{
anything.BeginInvoke((MethodInvoker)delegate
{
try
{
anything.Enabled = state;
}
catch
{
}
});
}
示例2: SetButtonText
public void SetButtonText(Button anything, string text)
{
anything.BeginInvoke((MethodInvoker)delegate
{
try
{
anything.Text = text;
}
catch
{
}
});
}
示例3: SetButtonText
protected void SetButtonText(Button b, string value)
{
if (b.InvokeRequired)
{
SetButtonTextCallback d = new SetButtonTextCallback(SetButtonText);
b.BeginInvoke(d, new object[] { b, value });
}
else
{
b.Text = value;
}
}
示例4: btnSetEnable
private void btnSetEnable(Button btn, bool enable)
{
if (btn.InvokeRequired)
{
btnSetEnableCallback d = new btnSetEnableCallback(btnSetEnable);
btn.BeginInvoke(d, new object[] { btn, enable });
}
else
{
btn.Enabled = enable;
}
}
示例5: SetButtonEnable
private void SetButtonEnable(Button b, bool value)
{
if (b.InvokeRequired)
{
SetButtonEnableCallback d = new SetButtonEnableCallback(SetButtonEnable);
b.BeginInvoke(d, new object[] { b, value });
}
else
{
b.Enabled = value;
}
}
示例6: EnableButton
private void EnableButton(Button btn, bool bEnable)
{
if (btn.InvokeRequired)
{
dEnableButton d = new dEnableButton(EnableButton);
btn.BeginInvoke(d, new object[] { btn, bEnable });
}
else
{
btn.Enabled = bEnable;
}
}