多线程程序中,新创建的线程不能访问UI线程创建的窗口控件,这时如果想要访问窗口的控件,发现无法对其控制。

这时可将窗口构造函数中的CheckForIllegalCrossThreadCalls设置为false;然后就能安全的访问窗体控件。

如果捕获了对错误线程的调用,则为 true;否则为 false。

---------------------------------

System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
程序初始化时设置这个属性,再使用微软Framework类库中的控件,系统将不会再抛出你线程的异常信息。

System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false的更多相关文章

  1. System.Windows.Forms.Control : Component, IOleControl, IOleObject, IOleInPlaceObject, IOleInPlaceActiveObject....

    #region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ...

  2. “FormCRUD.csProj.FormMain.Name”隐藏了继承的成员“System.Windows.Forms.Control.Name”。如果是有意隐藏,请使用关键字 new。

    一旦运行就显示:“FormCRUD.csProj.FormMain.Name”隐藏了继承的成员“System.Windows.Forms.Control.Name”.如果是有意隐藏,请使用关键字 ne ...

  3. System.Windows.Forms.ListView : Control

    #region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ...

  4. .net chart(图表)控件的使用-System.Windows.Forms.DataVisualization.dll

    这个案例指在介绍微软这套免费又功能强大的图表控件Microsoft Chart Controls for Microsoft .NET Framework 3.5,通过它,可让您的项目及报表,轻松套用 ...

  5. System.Windows.Forms

    File: winforms\Managed\System\WinForms\DataGridView.cs Project: ndp\fx\src\System.Windows.Forms.cspr ...

  6. 不用Invoke就等用 Control.CheckForIllegalCrossThreadCalls = false;

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  7. 用户控件的设计要点 System.Windows.Forms.UserControl

    用户控件的设计要点 最近的项目中有一个瀑布图(彩图)的功能,就是把空间和时间上的点量值以图的形式呈现出来,如下图: X坐标为空间,水平方向的一个像素代表一个空间单位(例如50米) Y坐标为时间,垂直方 ...

  8. System.Windows.Forms.Timer反编译学习

    using System; using System.ComponentModel; using System.Globalization; using System.Runtime; using S ...

  9. System.Windows.Forms.Timer

    一.主要属性.方法和事件 Windows 窗体 Timer 是定期引发事件的组件.该组件是为 Windows 窗体环境设计的. 时间间隔的长度由 Interval 属性定义,其值以毫秒为单位.若启用了 ...

随机推荐

  1. 苹果审核之遇到IPV6问题被拒的解决方法

    情景: 等待苹果审核上线时,发现因为IPV6被拒了.这是悲剧,以下是苹果审核给我的理由: We discovered one or more bugs on Wi-Fi connected to an ...

  2. 5.如何基于 dubbo 进行服务治理、服务降级、失败重试以及超时重试?

    作者:中华石杉 面试题 如何基于 dubbo 进行服务治理.服务降级.失败重试以及超时重试? 面试官心理分析 服务治理,这个问题如果问你,其实就是看看你有没有服务治理的思想,因为这个是做过复杂微服务的 ...

  3. Transformer —— attention is all you need

    https://www.cnblogs.com/rucwxb/p/10277217.html Transformer -- attention is all you need Transformer模 ...

  4. Linux(CentOS)上,安装了Apache(httpd)后,其他的电脑无法访问的原因

    今天试了下在虚拟机上利用CentOS系统的yum命令安装好了httpd(apache2.2),然后在windows系统下访问此虚拟机的ip地址,却访问不了. 因为前段时间有知道过iptable的限制, ...

  5. bind 仿造 重写bind

    简单版,不带参数 Function.prototype.my_bind = function(targ){ var _this = this; return function(){ _this.app ...

  6. Golang调用Python

    https://yq.aliyun.com/articles/117329 Python是时髦的机器学习御用开发语言,Golang是大红大紫的新时代后端开发语言.Python很适合让搞算法的写写模型, ...

  7. pointnet++的pytorch实现

    代码参考:https://blog.csdn.net/weixin_39373480/article/details/88934146 def recognize_all_data(test_area ...

  8. pointnet++之scannet/train.py

    1.作者可能把scannet数据集分成了训练集和测试集并处理成了.pickle文件. 2.在代码运行过程中,作者从.pickle文件中读出训练集1201个场景的x.y.z坐标和测试集312个场景的x. ...

  9. apktool android studio 调试 smali code, 重新打包

    虽然有些菜单的位置跟新版的Android Stuido 3.4 有些不同,但是能用. https://crosp.net/blog/software-development/mobile/androi ...

  10. nodejs的一些基操

    Nodejs 是基于 CHrome V8 引擎的 JaveScriptnpm: node 包管理器为我们提供了: nodejs 运行时,javascript 代码运行时的环境 提供了核心模块,具体会在 ...