什么是调用?
什么是方法调用,control.invoke?
在编程中一般调用什么
例子 :
MethodInvoker getValues = new MethodInvoker(delegate() { checkbox1Checked = checkbox1.Checked; textBox6Text = textBox6.Text; textBox7Text = textBox7.Text; textBox3Text = textBox3.Text; textBox1Text = textBox1.Text; textBox4Text = textBox4.Text; richTextBox1Text = richTextBox1.Text; textBox5Text = textBox5.Text; }); if (this.InvokeRequired) { this.Invoke(getValues); } else { getValues(); }
而且我也想知道MethodInvoker和InvokeRequired是什么意思?
“调用”是指调用方法。
在winforms中, Control.Invoke
用于调用UI线程上的方法 – 如果没有它,您可以通过从另一个线程更新UI来导致exception。
因此,如果InvokeRequires
返回true
则意味着您没有在UI线程中运行,并且应该使用Control.Invoke
在正确的线程中运行调用。
上述就是C#学习教程:什么是调用?分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/cdevelopment/1019327.html