Click here to Skip to main content
15,900,108 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
private void Open_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();
            string filename = openFileDialog1.FileName;
            if (File.Exists(filename) == true)
            {
                StreamReader sr = new StreamReader(filename);
                txt_lesson.Text = sr.ReadToEnd();
                sr.Read();

            }

}



i need to open a .htm file in my windows form.......
if i open with tiz code in textbox means it will display only the page source (html tags) only.....

i need to open as a web page
Posted
Updated 28-Mar-12 2:23am
v2

You would need somekind of webbrowser control to render the html.

Some options are:
Webkit: http://sourceforge.net/projects/webkitdotnet/?_test=b[^]
GeckoFX: http://code.google.com/p/geckofx/[^]
IE: http://msdn.microsoft.com/en-us/library/2te2y1x6.aspx[^]

Good luck!
 
Share this answer
 
You have WebBrowser control in Toolbox/Common Controls.
Just put it on your form and display html file using:

webBrowser1.Navigate(filename);
 
Share this answer
 
use webbrowser control with the help of this control you can
open .html file
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900