为什么我用2003的时候可以用this.close而2005的时候用this.close就不管用?

解决方案 »

  1.   

    在c/s上this.close 是可以关闭当前窗体的,在B/s就不可以了,不过在b/s上,你可以用javascript来关闭<script>window.close();</script>
      

  2.   

    是C/S的FORM1代码frmInfo.OpenWait();
    frmInfo.CloseWait();FORM2代码
    public void OpenWait()
    {
    m_BackThread = new System.Threading.Thread(new System.Threading.ThreadStart(this.yssShowForm));
    m_BackThread.Start();
    }public void CloseWait()
    {
    try
    {
            m_BackThread = null;
                    this.Close(); 
    }
    }
      

  3.   

    .net 2.0中不可以從非創建控件的線程中訪問控件。必須使用委托。
      

  4.   

    2005出于安全考虑,默认控件不能跨线程访问,必须设定一下。
    Control.CheckForIllegalCrossThreadCalls = false;