第一次使用AxWebBrowser,一片茫然。我在MDI窗体中如何调用AxWebBrowser打开一指定页面?谢谢

解决方案 »

  1.   

    我这样写的:
    System.Object nullObject = 0 ; 
    System.Object nullObjStr = null ; 
    ((System.ComponentModel.ISupportInitialize)(axWeb)).BeginInit();
    Controls.Add(axWeb);
    ((System.ComponentModel.ISupportInitialize)(axWeb)).EndInit();
    axWeb.Navigate( "about:blank" , ref nullObject , ref nullObjStr , ref nullObjStr , ref nullObjStr ) ;运行时报错:无法获取“AxWebBrowser”控件的窗口句柄。不支持无窗口的AxtiveX控件
    请问是怎末回事啊?
      

  2.   

    为何在mdi模式下页面无法显示?
      

  3.   

    可以的private void Form4_Load(object sender, System.EventArgs e)
    {
    object a = null;
    object b = null;
    object c = null;
    object d = null;
    axWebBrowser1.Navigate("http://blog.msnfans.com",ref a,ref b,ref c,ref d);
    }
    要先把WebBrowser控件添加到工具箱里,步骤是右键工具箱中的Windows窗体--〉添加/移除项,然后选中"COM组件"Tab页中的 Microsoft Web 浏览器,确定。WebBrowser控件就在工具箱里了,然后把它拖到WinForm上。
      

  4.   

    private void Form4_Load(object sender, System.EventArgs e)
    {
    object a = null;
    axWebBrowser1.Navigate("http://blog.msnfans.com",ref a,ref a,ref a,ref a);
    }