how to : copy html from a textbox and display as page in axwebbrowser

hawk1ns

Active member
Joined
Jun 10, 2003
Messages
37
can someone please explain how to copy html from a textbox and display as page in axwebbrowser.

I would like to be able to type in html into a textbox set at multiline and then click a button and have this html display as a webpage in the axwebbrowser window ?

any suggestions ?

Kind Regards
Carl
 
oops posted it in the wrong message before :rolleyes:
like this...
Code:
        AxWebBrowser1.Navigate("about:blank")
        While AxWebBrowser1.Busy
            Application.DoEvents()
        End While

        Dim objHtml As Object() = {TextBox1.Text}
        AxWebBrowser1.Document.GetType.InvokeMember("open", Reflection.BindingFlags.InvokeMethod, Nothing, AxWebBrowser1.Document, Nothing)
        /// open the document for writing ^^^
        AxWebBrowser1.Document.GetType.InvokeMember("write", Reflection.BindingFlags.InvokeMethod, Nothing, AxWebBrowser1.Document, objHtml)
        /// write the text^^^
        AxWebBrowser1.Document.GetType.InvokeMember("close", Reflection.BindingFlags.InvokeMethod, Nothing, AxWebBrowser1.Document, Nothing)
        /// close the document^^^
 
thanks for that :)

Thankyou .

However i seemed to get an error with this , the code looks ok and theres no apparent errors , and also runs ok , but when i click the button i get this error :

An unhandled exception of type System.NullReferenceException occurred in WindowsApplication7.exe

Additional information: Object reference not set to an instance of an object.

and highlights this line

AxWebBrowser1.Document.GetType.InvokeMember("open", Reflection.BindingFlags.InvokeMethod, Nothing, AxWebBrowser1.Document, Nothing)

Kind Regards
Carl
 
Back
Top