C# 如何使axMozillaBrowser控件在它导航另一个网页时等待berofe

C# 如何使axMozillaBrowser控件在它导航另一个网页时等待berofe,c#,.net,webbrowser-control,mozilla,C#,.net,Webbrowser Control,Mozilla,我正在创建一个简单的web浏览器重新加载程序。在我的程序中,我使用这些控件 axMozillaBrowser, Button, progressBar, TextBox 我试图加载网页“5”次。下面是我使用webBrowser控件(internet explorer的一个实例)时使用的代码 这是我使用AxMozilla浏览器控件(Mozilla浏览器的一个实例)时无法工作的代码。这不会加载网页,它正在等待光标闪烁 using System; using System.Collections.G

我正在创建一个简单的web浏览器重新加载程序。在我的程序中,我使用这些控件

axMozillaBrowser,
Button,
progressBar,
TextBox
我试图加载网页“5”次。下面是我使用webBrowser控件(internet explorer的一个实例)时使用的代码

这是我使用AxMozilla浏览器控件(Mozilla浏览器的一个实例)时无法工作的代码。这不会加载网页,它正在等待光标闪烁

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        while (progressBar1.Value !=5 )
        {
            axMozillaBrowser1.Navigate(textBox1.Text);
            while(axMozillaBrowser1.ReadyState != MOZILLACONTROLLib.tagREADYSTATE.READYSTATE_COMPLETE)
            {
            if (axMozillaBrowser1.ReadyState == MOZILLACONTROLLib.tagREADYSTATE.READYSTATE_COMPLETE)
            {
                    progressBar1.Value =+ 1;
            }
            }
        }
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        progressBar1.Maximum = 5;
        textBox1.Text = "www.google.com";
    }
}
}

您的浏览器控件是否已导航(或类似)事件? 例如,您可以在简单的逻辑循环中使用它,在这个循环中,您的控件导航到集合中的第一个URL,然后在导航完成后,导航到第二个URL和下一个URL

对不起,我又看了一遍,现在不明白了。
upd2:但我建议您查找Navigated和NavigationEvents以及NavigationState属性。

如果我不实现wait,它将无法正确加载页面,它将进入第二次导航,然后是第三次和第四次导航。这就是为什么我希望它等到第一次导航完成后再进行下一次请告诉我需要做什么才能使AxMozilla浏览器控件等到第一次导航完成后再进行下一次导航
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        while (progressBar1.Value !=5 )
        {
            axMozillaBrowser1.Navigate(textBox1.Text);
            while(axMozillaBrowser1.ReadyState != MOZILLACONTROLLib.tagREADYSTATE.READYSTATE_COMPLETE)
            {
            if (axMozillaBrowser1.ReadyState == MOZILLACONTROLLib.tagREADYSTATE.READYSTATE_COMPLETE)
            {
                    progressBar1.Value =+ 1;
            }
            }
        }
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        progressBar1.Maximum = 5;
        textBox1.Text = "www.google.com";
    }
}
}