Are you trying to contruct the html for the page yourself, then push the in
memory html into the browser? You can host the webbrowser control in your
application if so:
Add the webbrowser control from the designer and give it a name. In the
below example, I have "wb_unifiedReport"
private AxSHDocVw.AxWebBrowser wb_unifiedReport;
then to initialize, you must first navigate to some page to force mshtml to
load so oyou can use the dom and set your own text. (Alternatively, if you
just want to navigate to a page, just put the url below instead of
about
:blank.
// Prepare the webbrowser control for use (forces load of mshtml)
object o = null;
wb_unifiedReport.Navigate("about
:blank", ref o, ref o, ref o, ref o);
Now to set your own text
BrowserProxy.SetBrowserInnerHTML( wb_unifiedReport, strHTML );
This is a custom class of mine, but here is the code for the method:
public static void SetBrowserHTML( AxSHDocVw.AxWebBrowser browser, string
strHTML )
{
//string url = "about
:blank";
//object o = null;//System.Reflection.Missing.Value;
//browser.Navigate ( url,ref o,ref o,ref o,ref o);
object[] psa = {strHTML};
MSHTML.IHTMLDocument2 hDoc2 = (MSHTML.IHTMLDocument2)(browser.Document);
hDoc2.clear();
hDoc2.write(psa);
hDoc2.close();
}
Now you can create your own web documents in memory and push into a hosted
web browser control.
-David
"Mervin Williams" <mw*******@innovasolutions.net> wrote in message
news:um**************@TK2MSFTNGP12.phx.gbl...
From within a Windows form, I need create a html page and open it within
Internet Explorer. Does anyone know whether this is possible within a
Windows Forms application? If so, please provide an example.
Thanks in advance,
Mervin Williams