Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How a loaded HTML files can be displayed webbrowser in the resource?
Posted
Comments
deepankarbhatnagar 11-Aug-15 6:26am    
Can't understand

1 solution

Use WebBrowser control in form.
The following code display only 'about:blank' message, replace with your doc.
For C#
C#
private void DisplayHtml(string html)
{
    webBrowser1.Navigate("about:blank");
    if (webBrowser1.Document != null)
    {
        webBrowser1.Document.Write(string.Empty);
    }
    webBrowser1.DocumentText = html;
}

For VB.NET
VB
Private Sub DisplayHtml(ByVal html As String)
    webBrowser1.Navigate("about:blank")
    If webBrowser1.Document IsNot Nothing Then
        webBrowser1.Document.Write(String.Empty)
    End If
    webBrowser1.DocumentText = html
End Sub

Note: You should set AllowNavigation property to true before you deal with contents shown to users.
 
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