I'm using the Microsoft Web Browser control and the thing's driving me nuts. Specifically, I'm trying to assign text to the document object before the form shows on screen. Here's the form load:
Public Doc As mshtml.HTMLDocumentClass
Public txtMessage as String
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
AxWebBrowser1.Navigate2("about:blank") ' Supposedly creates a document object
Doc = AxWebBrowser1.Document ' Loads the browser
Doc.designMode = "On" ' Sets to design
If Not txtMessage Is Nothing Then
If txtMessage.Trim <> "" Then
Doc.body.innerHTML = txtMessage.Trim ' Error - doc = nothing
'doc' is always 'Nothing'. My problem is finding a point in the form processing where doc = something. If I don't assign a value to txtMessage.Text, the browser (editor) loads no problem and doc = something.
I've tried adding a Page_Load but it's never executed. Cause it's been overridden above?
So what comes after OnLoad in the order of form initialization? In which event can I assign this value where doc = something? (if you ask me it should already be something at this point)