在组件中加入axwebbrowser(web浏览器组件)

解决方案 »

  1.   

    object arg1 = 0; object arg2 = ""; object arg3 = ""; object arg4 = "";
    string url="http://www.sina.com.cn";
     AxWebBrowser1.Navigate(urlstr,ref arg1,ref arg2, ref arg3, ref arg4);
      

  2.   

    使用axWebBrowser,
    工具-》添加/移除工具箱-》COM组件 中找到
    添加进工具箱,就象其他控件一样使用
      

  3.   

    一个简单的浏览器的代码
    using System;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;
    using System.Data;
    using System.IO;namespace Internet浏览器
    {
    /// <summary>
    /// Form1 的摘要说明。
    /// </summary>
    public class Form1 : System.Windows.Forms.Form
    {
    private int i=0,j=1;
    private string[] str1=new string[6400];
    private string[] str=new string[1024];
    private System.Windows.Forms.MainMenu mainMenu1;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.ComboBox comboBox1;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.ToolBar toolBar1;
    private System.Windows.Forms.GroupBox groupBox1;
    private AxDHTMLEDLib.AxDHTMLEdit axDHTMLEdit1;
    private System.Windows.Forms.SaveFileDialog saveFileDialog1;
    private System.Windows.Forms.OpenFileDialog openFileDialog1;
    private System.Windows.Forms.ImageList imageList1;
    private System.Windows.Forms.MenuItem menuItem1;
    private System.Windows.Forms.MenuItem menuItem2;
    private System.Windows.Forms.MenuItem menuItem3;
    private System.Windows.Forms.MenuItem menuItem4;
    private System.Windows.Forms.MenuItem menuItem5;
    private System.Windows.Forms.MenuItem menuItem6;
    private System.Windows.Forms.MenuItem menuItem7;
    private System.Windows.Forms.MenuItem menuItem8;
    private System.Windows.Forms.MenuItem menuItem9;
    private System.Windows.Forms.MenuItem menuItem10;
    private System.Windows.Forms.MenuItem menuItem11;
    private System.Windows.Forms.ToolBarButton toolBarButton1;
    private System.Windows.Forms.ToolBarButton toolBarButton2;
    private System.Windows.Forms.ToolBarButton toolBarButton3;
    private System.Windows.Forms.ToolBarButton toolBarButton4;
    private System.Windows.Forms.ToolBarButton toolBarButton5;
    private System.Windows.Forms.ToolBarButton toolBarButton6;
    private System.ComponentModel.IContainer components; public Form1()
    {
    //
    // Windows 窗体设计器支持所必需的
    //
    InitializeComponent();

    //MessageBox.Show("i="+i.ToString()); //
    // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
    //
    } /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    protected override void Dispose( bool disposing )
    {
    if( disposing )
    {
    if (components != null) 
    {
    components.Dispose();
    }
    }
    base.Dispose( disposing );
    } #region Windows 窗体设计器生成的代码
    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
    this.components = new System.ComponentModel.Container();
    System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
    this.mainMenu1 = new System.Windows.Forms.MainMenu();
    this.menuItem1 = new System.Windows.Forms.MenuItem();
    this.menuItem4 = new System.Windows.Forms.MenuItem();
    this.menuItem5 = new System.Windows.Forms.MenuItem();
    this.menuItem6 = new System.Windows.Forms.MenuItem();
    this.menuItem7 = new System.Windows.Forms.MenuItem();
    this.menuItem2 = new System.Windows.Forms.MenuItem();
    this.menuItem8 = new System.Windows.Forms.MenuItem();
    this.menuItem9 = new System.Windows.Forms.MenuItem();
    this.menuItem3 = new System.Windows.Forms.MenuItem();
    this.menuItem10 = new System.Windows.Forms.MenuItem();
    this.menuItem11 = new System.Windows.Forms.MenuItem();
    this.label1 = new System.Windows.Forms.Label();
    this.comboBox1 = new System.Windows.Forms.ComboBox();
    this.button1 = new System.Windows.Forms.Button();
    this.toolBar1 = new System.Windows.Forms.ToolBar();
    this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
    this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
    this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
    this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
    this.toolBarButton5 = new System.Windows.Forms.ToolBarButton();
    this.toolBarButton6 = new System.Windows.Forms.ToolBarButton();
    this.imageList1 = new System.Windows.Forms.ImageList(this.components);
    this.groupBox1 = new System.Windows.Forms.GroupBox();
    this.axDHTMLEdit1 = new AxDHTMLEDLib.AxDHTMLEdit();
    this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
    this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
    this.groupBox1.SuspendLayout();
    ((System.ComponentModel.ISupportInitialize)(this.axDHTMLEdit1)).BeginInit();
    this.SuspendLayout();