本文整理汇总了C#中Form.BeginInvoke方法的典型用法代码示例。如果您正苦于以下问题:C# Form.BeginInvoke方法的具体用法?C# Form.BeginInvoke怎么用?C# Form.BeginInvoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form
的用法示例。
在下文中一共展示了Form.BeginInvoke方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
private static void Initialize()
{
// Run the message loop on another thread so we're compatible with a console mode app
var t = new Thread(() => {
frm = new Form();
var dummy = frm.Handle;
frm.BeginInvoke(new MethodInvoker(() => mre.Set()));
Application.Run();
});
t.SetApartmentState(ApartmentState.STA);
t.IsBackground = true;
t.Start();
mre.WaitOne();
}
示例2: CenterWinDialog
public CenterWinDialog(Form owner)
{
mOwner = owner;
owner.BeginInvoke(new MethodInvoker(findDialog));
}
示例3: setToolStripMenuItemToolTipText
public void setToolStripMenuItemToolTipText(Form in_me, ToolStripMenuItem set_me, string to_me)
{
if(in_me.InvokeRequired) {
in_me.BeginInvoke(new setToolStripMenuItemToolTipTextDelegate(setToolStripMenuItemToolTipText), new Object[] {in_me,set_me,to_me});
} else {
lock(set_me) {
set_me.ToolTipText = to_me;
}
}
}
示例4: setToolStripMenuItemEnabled
public void setToolStripMenuItemEnabled(Form in_me, ToolStripMenuItem set_me, bool to_me)
{
if(in_me.InvokeRequired) {
in_me.BeginInvoke(new setToolStripMenuItemEnabledDelegate(setToolStripMenuItemEnabled), new Object[] {in_me,set_me,to_me});
} else {
lock(set_me) {
set_me.Enabled = to_me;
}
}
}
示例5: setToolStripMenuItemCheckState
public void setToolStripMenuItemCheckState(Form in_me, ToolStripMenuItem set_me, CheckState to_me)
{
if(in_me.InvokeRequired) {
in_me.BeginInvoke(new setToolStripMenuItemCheckStateDelegate(setToolStripMenuItemCheckState), new Object[] {in_me,set_me,to_me});
} else {
lock(set_me) {
set_me.CheckState = to_me;
}
}
}
示例6: setNotifyIconVisible
public void setNotifyIconVisible(Form in_me, NotifyIcon set_me, bool to_me)
{
if(in_me.InvokeRequired) {
in_me.BeginInvoke(new setNotifyIconVisibleDelegate(setNotifyIconVisible), new Object[] {in_me,set_me,to_me});
} else {
lock(set_me) {
set_me.Visible = to_me;
}
}
}
示例7: setNotifyIconText
public void setNotifyIconText(Form in_me, NotifyIcon set_me, string to_me)
{
if(in_me.InvokeRequired) {
in_me.BeginInvoke(new setNotifyIconTextDelegate(setNotifyIconText), new Object[] {in_me,set_me,to_me});
} else {
lock(set_me) {
set_me.Text = to_me;
}
}
}
示例8: setFormShowInTaskbar
public void setFormShowInTaskbar(Form set_me, bool to_me)
{
if(set_me.InvokeRequired) {
set_me.BeginInvoke(new setFormShowInTaskbarDelegate(setFormShowInTaskbar), new Object[] {set_me,to_me});
} else {
lock(set_me) {
set_me.ShowInTaskbar = to_me;
}
}
}
示例9: closeForm
public void closeForm(Form close_me)
{
if(close_me.InvokeRequired) {
close_me.BeginInvoke(new closeFormDelegate(closeForm), new Object[] {close_me});
} else {
lock(close_me) {
close_me.Close();
}
}
}