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
 

panna_sn

Member
Joined
Apr 28, 2009
Messages
11
Programming Experience
1-3
Hi,

Webbrowser is the only way to do this.

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

Code:
dim path as string = AppDomain.CurrentDomain.BaseDirectory
webBrowser1.Navigate("file://" & path & "default.htm")
Thanks
Panna
 
Last edited by a moderator:

panna_sn

Member
Joined
Apr 28, 2009
Messages
11
Programming Experience
1-3
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

Member
Joined
Apr 28, 2009
Messages
11
Programming Experience
1-3
ok, thank u.

the vb.net code is,

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