Skip to content

Instantly share code, notes, and snippets.

@kypflug
Created May 9, 2018 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kypflug/14e0738c80940bbb80babd626de7eef4 to your computer and use it in GitHub Desktop.
Save kypflug/14e0738c80940bbb80babd626de7eef4 to your computer and use it in GitHub Desktop.
using Microsoft.Toolkit.Win32.UI.Controls.WinForms;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
// Initialize WebView and add it to the Window's controls
var wvc = new WebView();
((ISupportInitialize)wvc).BeginInit();
wvc.Dock = DockStyle.Fill;
Controls.Add(wvc);
((ISupportInitialize)wvc).EndInit();
// You can also use the Source property
wvc.Navigate(new Uri("https://www.microsoft.com"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment