Good Jobs man ! Form1.WebView2.Source = New Uri("your https here") No error " System.NullReferenceException: 'Object reference not set to an instance of an object.'" the code is perfect
I copied the .exe and the 3 dll files to another device, but unfortunately, the Webview2 doesn't work there. What could be the reason for this? The 'MicrosoftEdgeWebview2Setup' installation is already installed. 😕
When distributing your application, there are a few ways you can ensure the WebView2 Runtime is on client machines. For client machine please select download Evergreen Standalone Installer x86 or x64. developer.microsoft.com/en-us/microsoft-edge/webview2
Private Sub WebView21_CoreWebView2Ready(sender As Object, e As EventArgs) Handles WebView21.CoreWebView2Ready WebView21.CoreWebView2.Settings.AreDefaultContextMenusEnabled = False End Sub
If you want to implement it, just use the EXE file and 2 DLL Files are Microsoft.Web.WebView2.WinForms.dll and Microsoft.Web.WebView2.Core.dll. (Please see at BIN Directory)
Id Recommend just get all the files from the bin Creating A Head Folder Pasting Them Creating A Shortcut To The EXE And Then Put It In a Zip folder To Share/Extract
It would be much better if you actually narrated what you are doing. Just music that sounds like it was stolen from DOOM 1 with no explanation is not helpful
saved my life. Thank you
Good Jobs man ! Form1.WebView2.Source = New Uri("your https here") No error " System.NullReferenceException: 'Object reference not set to an instance of an object.'" the code is perfect
I copied the .exe and the 3 dll files to another device, but unfortunately, the Webview2 doesn't work there. What could be the reason for this? The 'MicrosoftEdgeWebview2Setup' installation is already installed. 😕
When distributing your application, there are a few ways you can ensure the WebView2 Runtime is on client machines. For client machine please select download Evergreen Standalone Installer x86 or x64. developer.microsoft.com/en-us/microsoft-edge/webview2
Hello, How can I disable right click on webview2 and disable from using the ALT key in the browser?
Private Sub WebView21_CoreWebView2Ready(sender As Object, e As EventArgs) Handles WebView21.CoreWebView2Ready
WebView21.CoreWebView2.Settings.AreDefaultContextMenusEnabled = False
End Sub
I have build and deploy the project it's not working on me, did you also try to deploy this kind of project?
Omg thank you!!!
Any chance to access webview2 control for a VBA userform?
Im doing exactly the same as you but it doesnt work.
You can download source code @here ... github.com/thongkorn/WebView2
I am not able to use Asc in my case why is that?? please reply me asap I am in urgent need of it
You can download source code @here ... github.com/thongkorn/WebView2
How to distribute? Doesn't just happen.
If you want to implement it, just use the EXE file and 2 DLL Files are Microsoft.Web.WebView2.WinForms.dll and Microsoft.Web.WebView2.Core.dll. (Please see at BIN Directory)
Thanks!
Can you make a c# tutorial with webview 2 amd easytabs please
Sorry, but I'm good only visual basic language.
@@g2gnet okay
@@g2gnet maybe in can help little bit with my code as start maybe if you want that
@@g2gnet ublic frmBrowser()
{
InitializeComponent();
webView21.NavigationStarting += EnsureHttps;
InitializeAsync();
}
void EnsureHttps(object sender, CoreWebView2NavigationStartingEventArgs args)
{
String uri = args.Uri;
if (!uri.StartsWith(""))
{
webView21.CoreWebView2.ExecuteScriptAsync($"alert('{uri} may not be safe, try an https link')");
args.Cancel = true;
txtUrl.IconLeft = Properties.Resources.delete_shield_40px;
}
else
{
txtUrl.IconLeft = Properties.Resources.shield_48px;
}
}
private async void frmBrowser_Load(object sender, EventArgs e)
{
panel2.Visible = false;
panel2.Enabled = false;
}
protected TitleBarTabs ParentTabs
{
get
{
return (ParentForm as TitleBarTabs);
}
}
private void btnRefresh_Click(object sender, EventArgs e)
{
webView21.Reload();
}
private void btnGo_Click(object sender, EventArgs e)
{
if (webView21 != null && webView21.CoreWebView2 != null)
{
webView21.CoreWebView2.Navigate(txtUrl.Text);
}
}
private void txtUrl_KeyPress(object sender, KeyPressEventArgs e)
{
}
async void InitializeAsync()
{
await webView21.EnsureCoreWebView2Async(null);
webView21.CoreWebView2.WebMessageReceived += UpdateAddressBar;
await webView21.CoreWebView2.AddScriptToExecuteOnDocumentCreatedAsync("window.chrome.webview.postMessage(window.document.URL);");
}
void UpdateAddressBar(object sender, CoreWebView2WebMessageReceivedEventArgs args)
{
String uri = args.TryGetWebMessageAsString();
txtUrl.Text = uri;
webView21.CoreWebView2.PostWebMessageAsString(uri);
}
private void txtUrl_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter && txtUrl.Text.Trim().Length > 0)
{
//detect url
if (txtUrl.Text.Contains("."))
{
//ites a url
webView21.CoreWebView2.Navigate(txtUrl.Text.Trim());
}
else
{
//its a search
webView21.CoreWebView2.Navigate("www.google.com/search?client=opera&q=" + txtUrl.Text.Trim().Replace(" ", "+") + "&sourceid=opera&ie=UTF-8&oe=UTF-8");
}
}
}
private void btnBack_Click(object sender, EventArgs e)
{
webView21.GoBack();
}
private void btnForward_Click(object sender, EventArgs e)
{
webView21.GoForward();
}
private void btnMenu_Click(object sender, EventArgs e)
{
panel2.Visible = true;
panel2.Enabled = true;
}
private void btnClose_Click_1(object sender, EventArgs e)
{
panel2.Visible = false;
panel2.Enabled = false;
}
private void btnSettings_Click(object sender, EventArgs e)
{
Settings st = new Settings();
st.ShowDialog();
}
}
mainform
Many many thanks
Please make a video how to export it in exe and install on other computers
Id Recommend just get all the files from the bin Creating A Head Folder Pasting Them Creating A Shortcut To The EXE And Then Put It In a Zip folder To Share/Extract
It dosent working...
You can download source code @here ... github.com/thongkorn/WebView2
you should let all your project to us make download
This video clip you can definitely do simple projects without source code from me.
ขอเฟส บุ๊คได้มั้ยครับ อยากเรียน เวริคช็อป พอดีผมเขียน แต่ vba ใน excel อยากลอง ตรงนี้บ้างครับ
facebook.com/g2gnet
That’s really shitty rock music, thus royalty-free public domain.
It would be much better if you actually narrated what you are doing. Just music that sounds like it was stolen from DOOM 1 with no explanation is not helpful