你有把代码写在load事件或构造函数中吗?

解决方案 »

  1.   

    .......................
    this.Load += new System.EventHandler(this.Web_Load);
    .......................
    .......................
    public void Web_Load(object sender, System.EventArgs e)
    {
    //指定访问网页
    string str="";
    System.Object nullObject=0;
    System.Object nullObjStr=str;
    this.Web_Login.Navigate("http://localhost",ref nullObject,ref nullObjStr,ref nullObjStr,ref nullObjStr);
    this.Web_Login.Show();
    this.Refresh();
    }
    .........................................