如题,我好像一直报错

解决方案 »

  1.   

    我会出现一个这样的问题:Exception
    Cross-thread operation not valid: Control 'textBox4' accessed from a thread other than the thread it was created on.但是,我想要在线程里面对UI操作怎么办?比如我要对开5个thread,作下载,要在listview里面写提示语句:如线程1开始下载,线程2下载完毕。怎么做啊?
      

  2.   

    托管调用 参考以下代码
    //声明一个URL委托
    private delegate void ShowURLdelegate(string Info);
    //定义一个URL委托对象
    private ShowURLdelegate URLdelegate;
    private void ShowURL(string Info)
    {
    currentURL.Text=Info;
    }
    public void InvokeShowURL(string Info)
    {
    this.BeginInvoke(URLdelegate,new object[]{Info});
    }在你的线程里调用InvokeShowURL就行了
      

  3.   

    I have solve the problem.Thank you