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_unifiedRepo rt"
private AxSHDocVw.AxWeb Browser wb_unifiedRepor t;
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_unifiedRepor t.Navigate("abo ut:blank", ref o, ref o, ref o, ref o);
Now to set your own text
BrowserProxy.Se tBrowserInnerHT ML( wb_unifiedRepor t, strHTML );
This is a custom class of mine, but here is the code for the method:
public static void SetBrowserHTML( AxSHDocVw.AxWeb Browser browser, string
strHTML )
{
//string url = "about
:blan k";
//object o = null;//System.Reflecti on.Missing.Valu e;
//browser.Navigat e ( url,ref o,ref o,ref o,ref o);
object[] psa = {strHTML};
MSHTML.IHTMLDoc ument2 hDoc2 = (MSHTML.IHTMLDo cument2)(browse r.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*******@inno vasolutions.net > wrote in message
news:um******** ******@TK2MSFTN GP12.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