Question Load html into windows form

ali-2006

New member
Joined
Apr 28, 2009
Messages
3
Programming Experience
1-3
I want to load a html code into a windows form
i putted the code into a htm file in the solution but i don't know how to load it in the windows form

i read about webbrowser control but i still succeed

please help
 
Hi,

Webbrowser is the only way to do this.

put the following code in the form's load event.

VB.NET:
dim path as string = AppDomain.CurrentDomain.BaseDirectory
webBrowser1.Navigate("file://" & path & "default.htm")

Thanks
Panna
 
Last edited by a moderator:
put an html file named 'default.htm' with desired html code in ~/bin/debug. Drag a webbrowser control and then type the above 2 lines of code.

This code is in c#.net on vs2008, so u can change it to vb.net if required.

Thanks
Panna
 
panna_sn, this is a VB.Net forum site, use VB.Net language when posting here in future.
 
ok, thank u.

the vb.net code is,

Dim path As String = AppDomain.CurrentDomain.BaseDirectory
webBrowser1.Navigate("file://" & path & "default.htm")
 
Back
Top