Tia ;
In Getting started with WebView2 in Windows Forms apps Step 3.4
Program compliles ok , But doesnt Navigate to https://www.microsoft.com .
Neither does it Navigate on goButton_Click .
Code Below , Form1.Designer.cs followed by Form1.cs .
this.webView.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.webView.Location = new System.Drawing.Point(12, 55);
this.webView.Name = "webView";
this.webView.Size = new System.Drawing.Size(1115, 426);
this.webView.Source = new System.Uri("https://www.microsoft.com", System.UriKind.Absolute);
this.webView.TabIndex = 0;
this.webView.Text = "webView";
this.webView.ZoomFactor = 1D;
/////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Web.WebView2.Core;
namespace WinFormsGettngStarted
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.Resize += new System.EventHandler(this.Form_Resize);
webView = new Microsoft.Web.WebView2.WinForms.WebView2();
}
private void Form_Resize(object sender, EventArgs e)
{
webView.Size = this.ClientSize - new System.Drawing.Size(webView.Location);
goButton.Left = this.ClientSize.Width - goButton.Width;
addressBar.Width = goButton.Left - addressBar.Left;
}
private void goButton_Click(object sender, EventArgs e)
{
if (webView != null && webView.CoreWebView2 != null)
{
webView.CoreWebView2.Navigate(addressBar.Text);
}
}
private void addressBar_TextChanged(object sender, EventArgs e)
{
}
}
}