|
-
Jun 22nd, 2006, 11:26 AM
#1
Thread Starter
Hyperactive Member
Displaying HTML in webbrowser control
If I added some HTML to say, Text1.Text and then create a command button that would add the html from Text1 TO Webbrowser and display it, how would I do that?
I've tried everything:
WebBrowser1 = Text1.Text
WebBrowser1.Document.Body.innerHTML = Text1.Text
Any idea?
Thanks a lot!
Paul
-
Jun 22nd, 2006, 12:23 PM
#2
Hyperactive Member
Re: Displaying HTML in webbrowser control
I'm fairly sure you have to save it to a temp file, and then navigate to the temp file.
Could be wrong.
-
Jun 22nd, 2006, 12:26 PM
#3
Member
Re: Displaying HTML in webbrowser control
yea u have to save the file as .html like you would with notepad or web editor then use the address of the file C://file.html or wot ever.
to my small knowledge u carnt do wot ur asking.
I finaly gave something back to this site
-
Jun 22nd, 2006, 12:32 PM
#4
Re: Displaying HTML in webbrowser control
no you do not have to do that...
Im working on a large tutorial on my website... click HERE to check it out
but here is how you would do that...
VB Code:
Private Sub Form_Load()
WebBrowser1.Navigate "about:blank"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WebBrowser1.Application) Then
If URL = "about:blank" Then
WebBrowser1.Document.write "<HTML>HTML GOES HERE</HTML>"
End If
End If
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 22nd, 2006, 01:39 PM
#5
Lively Member
Re: Displaying HTML in webbrowser control
Try this ...
Private Sub Form_Load()
Dim sHTML as String
sHTML = <your html code>
WebBrowser.Navigate "about:" & sHTML
End Sub
I'm not sure if it works all the time; but yeh, it worked this time!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|