[英]C# How to close a windows form on the main UI thread from another thread
[英]C#: How do you access an integer in the main UI thread from another thread?
如何从异步回调函数的方法访问主窗体中的整数(增量nCount ++)?
我知道使用方法你必须检查是否需要调用,然后调用begininvoke作为委托的目标方法,以避免非法的线程操作,但是如何从另一个线程执行简单的操作,如nCount ++?
Interlocked.Increment(ref variable);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.