Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Web.WebView2.Wpf;
- namespace WinFormsApp1.ext;
- public partial class Window : Form
- {
- private String name = "Undefined";
- private String text = "Undefined";
- private String url = "";
- public Microsoft.Web.WebView2.WinForms.WebView2 webView21;
- public Window(String title, String url, int width = 800, int height = 600)
- {
- this.url = url;
- this.webView21 = new Microsoft.Web.WebView2.WinForms.WebView2();
- this.webView21.Source = new Uri(this.url);
- this.webView21.Size = new System.Drawing.Size(800, 600);
- this.Controls.Add(this.webView21);
- this.Text = title;
- this.name = title;
- this.Size = new System.Drawing.Size(800, 600);
- this.Resize += onResize;
- }
- private void onResize(object sender, EventArgs e)
- {
- this.webView21.Size = this.Size;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement