概要
cscの作法、調べてみた。
webview2やってみた。
写真
サンプルコード
using System;
using System.Windows.Forms;
using Microsoft.Web.WebView2.WinForms;
using Microsoft.Web.WebView2.Core;
class WebViewForm: Form {
private WebView2 webView;
public WebViewForm() {
this.Width = 1000;
this.Height = 700;
webView = new WebView2();
webView.Dock = DockStyle.Fill;
this.Controls.Add(webView);
this.Load += async (s, e) => {
await webView.EnsureCoreWebView2Async();
webView.CoreWebView2.Navigate("https://www.yahoo.co.jp/");
webView.CoreWebView2.NavigationCompleted += async (sender, args) => {
// 何か処理
};
};
}
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.Run(new WebViewForm());
}
}
使ったDLL
Microsoft.Web.WebView2.Core.dll
Microsoft.Web.WebView2.WinForms.dll
WebView2Loader.dll
以上。