navigating the web browser control to a file

G

Guest

Hi,
I have an application that has the webbrowser control.

I have no problem setting the webbrowser to show a html page hosted on a web
site, but in my application I am shipping a small number of HTML file that
will be installed with my application, and I need to have the webbrowser
control display these pages.

WebBrowser1.Navigate("http://www.microsoft.com") ' works fine

WebBrowser1.Navigate("htmlpage1.htm")


The catch is that the htmlpage1.html page is installed with the application
and could be on any drivepath the user selected when they installed the app.

Thanks
 
O

Onur Güzel

Hi,
I have an application that has the webbrowser control.

I have no problem setting the webbrowser to show a html page hosted on a web
site, but in my application I am shipping a small number of HTML file that
will be installed with my application, and I need to have the webbrowser
control display these pages.

        WebBrowser1.Navigate("http://www.microsoft.com") ' works fine

        WebBrowser1.Navigate("htmlpage1.htm")

The catch is that the htmlpage1.html page is installed with the application
and could be on any drivepath the user selected when they installed the app.

Thanks

Assuming HTML file is located in application's root folder, you can
determine path using Application.StartupPath then navigate to file
using webbrowser:

Webbrowser1.Navigate(Application.StartupPath & "\htmlpage1.htm")

Onur Güzel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top