本文整理汇总了C#中System.Windows.Forms.BeginInvoke方法的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Forms.BeginInvoke方法的具体用法?C# System.Windows.Forms.BeginInvoke怎么用?C# System.Windows.Forms.BeginInvoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms
的用法示例。
在下文中一共展示了System.Windows.Forms.BeginInvoke方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformToggle
private void PerformToggle (SWF.CheckBox checkbox, SWF.CheckState state)
{
if (checkbox.InvokeRequired == true) {
checkbox.BeginInvoke (new PerformToggleDelegate (PerformToggle),
new object [] { checkbox, state });
return;
}
// NOTE: We can count on presence of InvokeOnClick;
// it is a protected member of CheckBox.
//
// This basically simulates a click, which always
// raises the Click event, but strangely does not
// raise CheckChanged when transitioning to
// Indeterminate state. This matches MS behavior.
MethodInfo invokeOnClick =
typeof (SWF.CheckBox).GetMethod ("InvokeOnClick",
BindingFlags.NonPublic |
BindingFlags.Instance);
invokeOnClick.Invoke (checkbox,
new object [] {checkbox, EventArgs.Empty});
}
示例2: PerformSetVisualState
private void PerformSetVisualState (SWF.Form form, SWF.FormWindowState state)
{
if (form.InvokeRequired == true) {
form.BeginInvoke (new PerformSetVisualStateDelegate (PerformSetVisualState),
new object [] { form, state });
return;
}
form.WindowState = state;
}
示例3: PerformSelectDelegate
private void PerformSelectDelegate (SWF.RadioButton radioButton)
{
if (radioButton.InvokeRequired == true) {
radioButton.BeginInvoke (new PerformSelectDelegate (PerformSelectDelegate),
new object [] { radioButton });
return;
}
radioButton.Checked = true;
}
示例4: PerformExpandOrCollapse
private void PerformExpandOrCollapse (SWF.ComboBox combobox, bool droppedDown)
{
if (combobox.InvokeRequired == true) {
combobox.BeginInvoke (new PerformExpandOrCollapseDelegate (PerformExpandOrCollapse),
new object [] { combobox, droppedDown } );
return;
}
combobox.DroppedDown = droppedDown;
}