J
jhattersley
Hi Folks,
Wonder if you can help...
All I'm trying to do is load a couple of simple HTML pages (in memory)
into the WebBrowser control, one after the other. I don't seem to be
able to clear the contents of the WebBrowser before I show the next
page, they're appended one after the other.
I've got some really simple code:
private void Form1_Load(object sender, System.EventArgs e)
{
Object o = null;
axWebBrowser1.Navigate("about:blank", ref o, ref o, ref o, ref o);
document = (IHTMLDocument2) axWebBrowser1.Document;
document.writeln("<h1>One</h2>");
}
private void button2_Click(object sender, System.EventArgs e)
{
document = (IHTMLDocument2) axWebBrowser1.Document;
document.clear();
axWebBrowser1.Refresh();
document.writeln("<h1>Two</h1>");
}
Any suggestions, I'm being stupid, but I can't see why and I've spent
too long on this already.
Thanks Dudes.
John
Wonder if you can help...
All I'm trying to do is load a couple of simple HTML pages (in memory)
into the WebBrowser control, one after the other. I don't seem to be
able to clear the contents of the WebBrowser before I show the next
page, they're appended one after the other.
I've got some really simple code:
private void Form1_Load(object sender, System.EventArgs e)
{
Object o = null;
axWebBrowser1.Navigate("about:blank", ref o, ref o, ref o, ref o);
document = (IHTMLDocument2) axWebBrowser1.Document;
document.writeln("<h1>One</h2>");
}
private void button2_Click(object sender, System.EventArgs e)
{
document = (IHTMLDocument2) axWebBrowser1.Document;
document.clear();
axWebBrowser1.Refresh();
document.writeln("<h1>Two</h1>");
}
Any suggestions, I'm being stupid, but I can't see why and I've spent
too long on this already.
Thanks Dudes.
John