I know this has been asked before, but i have looked the post and still cant figure it out.
i want to display html on a form. i am converting a vb6 form to vb.net and cant figure out how to add a webcontrol, which is what is on the vb6 form!!!
I wanted to do the same thing and searched forever for it on various search engines to no avail. Then I stumbled on an answer. I'm not sure this is the best solution or where I found it but:
in the Visual Studio IDE, right-click in the toolbox panel, select 'Customize Toolbox...', go to the 'Com Components' tab. Look for 'Microsoft Web Browser' (default location is "c:\WINDOWS\system32\shdocvw.dll". Select the checkbox and click OK.
ok, i have got the control on my form and all look ok.
ihave the following code, i was hoping it was going to display the htm file but nothing happens the form loads with a blank white Explorer control.
I get the the following messages
"File found"
then
"something went wrong with the html.."
Try
If File.Exists("d:\PreMessage" & sLangID & ".htm" Then
MsgBox("found file"
'set the html control = the file name
'#######################################################
'########## HTML control ################################
'########################################################
It'd probably help to know what the actual error is. You can change your [tt]Catch[/tt] to [tt]Catch ex As Exception[/tt]. Then change your MsgBox to:
[tt]MsgBox(ex.Message)[/tt]
[tt]MsgBox(ex)[/tt] would give even more information, but it's probably more than you need to know what happened here.
i dont have the associated
Private Sub AxWebBrowser1_NavigateComplete2(ByVal sender As Object, _
ByVal e As AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event) _
Handles AxWebBrowser1.NavigateComplete2
sub in my project,,,does that make any difference??
Try the Navigate2 method of the Web Browser control.
Navigate2 method remarks:
"This method extends the Navigate method to allow for shell integration; however, the original Navigate method can still be used for URL navigations (Navigate2 does not make Navigate obsolete)."
_______________________________________________
Not having the NavigateComplete2 event handler in your project isn't the problem. This event fires when part of the document has been received from the server, and the viewer for the document has been created. I usually use it to display the current URL. I would normally add it to a combo box, but for simplicity:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.