Sumit Goyal
Sumit Goyal

Reputation: 165

Load local html file in webbrowser control in editable mode

I want to load a local html file in webbrowser control in editable mode. My code for loading in html file in webBrowser is:

private void LoadFile(string filename)
{
    using (StreamReader reader = File.OpenText(filename))
    {
       webBrowser1.DocumentText = reader.ReadToEnd();
       reader.Close();
       Text = webBrowser1.DocumentTitle;
    }
}

But it is not editable.

Upvotes: 1

Views: 5621

Answers (1)

Akshay Joy
Akshay Joy

Reputation: 1765

Please check this snippet.

 webBrowser1.AllowWebBrowserDrop = false;
    webBrowser1.Url = new Uri(@"D:\TEMP\sample.htm");

Upvotes: 2

Related Questions