运行时的异常:
[System.InvalidOperationException] = {"Action being performed on this control is being called from the wrong thread. Marshal to the correct thread using Control.Invoke or Control.BeginInvoke to perform this action."}
我不了接能不能详细说说,往宽泛方面展开说说。

解决方案 »

  1.   

    在线程里直接调用this获得控件的句柄对其操作抛出异常,而要调用Invoke()这样是不是为了防止同步问题,或者还有其他考虑?
      

  2.   

    非主线程修改控件的值需要通过Invoke调用
      

  3.   

    不要在非UI线程中调用调整UI界面的方法,比如在begininvok中向控件中添加子控件,修改样式等,如果在异步调用中需要修改UI,需要回到UI线程来执行,方法就是使用control.invok来调用
      

  4.   

     CheckForIllegalCrossThreadCalls =false