Hi,
Why not let the page raise an event? For instance, something like:
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace TestWebBrowser
{
[ComVisible(true)]
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, System.EventArgs e)
{
webBrowser1.ObjectForScripting = this;
webBrowser1.DocumentText = @"
<html>
<body onLoad='jscript:window.external.DocumentLoaded();'>
<img src=""http://www.nasa.gov/images/content/464377main_image_1695_1600-1200.jpg"" />
</body>
</html>";
}
public void DocumentLoaded()
{
MessageBox.Show("Document Finished Loading.");
}
}
}
In the above sample the page uses the onLoad() event to notify the form when the page has finished loading.
Hope this helps.