Note: Advice in this article will only work for DotNetBrowser 1.
See the corresponding article for DotNetBrowser 2 here.

The following sample code demonstrates how to create WinForms Browser instance, embed it into a Form and load URL. More details about configuring the sample can be found in the Quick Start Guide.

The sample solution that demonstrates how to embed lightweight or heavyweight controls into Windows Forms can be found in the attachments. The projects in this solution have NuGet dependencies, which will be resolved automatically during the build.

Adding DotNetBrowser to the Toolbox

If you want to add the DotNetBrowser controls to the Visual Studio Toolbox, the most convenient way is to download and install the VSIX package that is available at Visual Studio gallery.

Embedding from the Code



using System.Windows.Forms;
using DotNetBrowser;
using DotNetBrowser.WinForms;

namespace WinForms.DotNetBrowser
    public partial class Form1 : Form
        public Form1()

            BrowserView browserView = new WinFormsBrowserView();
            Controls.Add((Control) browserView);



Imports DotNetBrowser
Imports DotNetBrowser.WinForms

Public Class Form1

    Public Sub New()

        Dim browserView As BrowserView

        browserView = New WinFormsBrowserView()
    End Sub
End Class