I've figured out something that works in my case. It's not necessarily the most elegant but it gets the job done.
I set the default Opacity
of the WebBrowser
to 0. Then, I attach an event handler for the LoadCompleted
event:
private void browser_Post_LoadCompleted(object sender, NavigationEventArgs e)
{
browser_Post.Opacity = 1;
}
Now, before I load a new HTML page, I set the Opacity
back to 0 so it hides the browser while the new HTML is being rendered so there is no flickering of backgrounds. When the HTML is finished loading the event will fire and the new HTML page will be shown as expected.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…