Reputation: 11
I want to create a visual program using C# window form app so I would like to ask how can I browse or open a local html document that i created which is located on my desktop using C# VS?
Upvotes: 0
Views: 185
Reputation: 1504
You could use the "WebBrowser" control on a form or usercontrol to achieve this.
It should exist in your "Toolbox", categorized under "Common Controls". You will drag and drop it onto your Form or UserControl tabbed window - during design mode (note the [Design] in the tab text and visual display).
you can review more information on the control here
the class documentation here, which provides an example of it's usage.
Upvotes: 1
Reputation: 1803
try this
Process.Start(urlToOpen);
or add WebBrowser
in your form then load the url
or file path
.
And in your Form Load Event
webBrowser1.Url = new Uri("filepath or url");
Upvotes: 1