Все это можно сделать используя стандартный webbrowser control.
Делается это так:
- подписываете ваш webbrowser control на событие DocumentComplete:
this.webBrowser.DocumentComplete += new AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(this.webBrowser_DocumentComplete);
- потом, когда надо отобразить что то в этом webbrowser вызываете:
object flags = null;
object targetFrame = null;
object postData = null;
object headers = null;
webBrowser.Navigate("about:blank"), ref flags, ref targetFrame, ref postData, ref headers);
- добавьте в проект reference на Microsoft.mshtml.dll (C:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll)
- вот, что должно быть в обработчике DocumentComplete:
private void webBrowser_DocumentComplete(object sender, AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
// get the main document from the browser
mshtml.IHTMLDocument2 mainDoc = this.webBrowser.Document as mshtml.IHTMLDocument2;
if (mainDoc != null && e.uRL != null && e.uRL.ToString() == "about:blank")
{
mainDoc.write("<insert your HTML here>");
}
}
Thank you,
Misha Zhutov
http://submain.com - .NET Developer Tools
Microsoft
MVP