WebKit.NET component not working correctly - c#

I'm trying to make basic webbrowser in C# in Visual Studio, but I won't use built-in webbrowser component with IE rendering engine. So I downloaded WebKit.NET and added to my project. But it can load only one page - google.com. So when I put google.com to textbox and then press button, it works. But if I put to textbox else adress (toutube.com, facebook.com,...) it does nothing. With buit-in webbrowser everything works fine, but still on IE engine. Where can be mistake? The code is:
private void button1_Click(object sender, EventArgs e)
{
webkitBrowser1.Navigate(textBox1.Text);
}

Related

Trying to use the "launch url on c#" but doesnt work

read title
Here is the code i'm using
System.Diagnostics.Process.Start("My url, dont wanna show it xd");
But visual studio tells this
screenshot
i tried using the light, but tells
this
You need to add a method to the click event before you can call the Process.Start. For instance:
button14.Click += Button14_Click;
Now if you click the button it will open the browser.
private void Button14_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("my url");
}
Have you tried
Process.Start("chrome.exe", "http://www.YourUrl.com");
Similar question here: How to launch a Google Chrome Tab with specific URL using C#

Textbox_Enter event not does nothing

I want to be able to tell when the user cliked on a textbox and is in "edit" mode. Everywhere I look I see the textbox_Enter and textbox_Leave events being used with the instructions within that and it works fine. For me however it doesn't do anything. I tried elimination as many outside factors as possible, including creating a brand new project just for testing purposes and copied some code samples yet again nothing happens when I click on the textbox. I'm using Visual Studio 2017 on Windows 10 with Visual C# Application Windows Form (.NET Framework)
Also here's a sample of the code I try to use if it helps for whatever reason
private void textbox_Enter(object sender, ControlEventArgs e)
{
label.Text = "ok";
}
First of all the type of the e parameter is not correct: It must be EventArgs, not ControlEventArgs:
private void textbox_Enter(object sender, EventArgs e)
{
// Do something
}
Second, you need to register the event in the forms designer with the textbox control in the properties window:
You need to wire up this method to the textbox enter event. Select the control and then look at the events section in the properties tab.

Get .net webbrowser full screen event

I have a windows form application,there is a webbrowser control on the middle of the form. that navigates to a Youtube video, the full screen button of the video doesn't work.
How can i get the fullscreen event (when triggered using html or flash)?
void MainFormLoad(object sender, EventArgs e){
this.KeyDown+= new KeyEventHandler(MainForm_KeyDown);}
void MainForm_KeyDown(object sender, KeyEventArgs e){
if( e.KeyCode == Keys.ControlKey)
MessageBox.Show("What is the Ctrl?");}
I am still shocked by how bad IE 11 shows web pages. So I strongly recommend using another engine like Chromium. View this post in order to know about library options.
I went with CefSharp and there is a great How To Guide in here But the browser lakes just full screens to form boundaries, so be noted in case using this option you might need to implement it yourself.

WebBrowser does not change

I'm making an application in C# which, depending of a variable, shows one web page or another.
When I push a button, the program load the userName and the webBrowser should show a different web page. Here is my source code:
private void button1_Click(object sender, EventArgs e) {
string url = "http://www.url.com/" + userName;
webBrowser1.Navigate(url);
webBrowser1.Refresh();
}
The problem is that, when I push the button a second time with a different variable, the web browser reloads the same web page.
I think it's because of the webBrowser1.Refresh(); you don't need it and i think you are pushing the button 2 consecutive times with different values and it gives you the impression that it's loading another page but it isn't. try to remove that line and add an event to the Navigated method of your WebBrowser object in order to obtain a feedback when the browser is done loading the page.
I have solved my problem. I had set the property AllowNavigation to false, so, when I tried to change the web page, it didn't allow me to did it. Anyway, I needed to remove the Refreshcall to make it work.

Detect whether user has clicked on a specific link inside a Browser Control?

I'm not using the in-built browser control (ie wrapper) but i'm using Webkit.Net instead
When i click on button1, the WebkitBrowser will navigate to the link typed on textBox1
private void Button1_Click(object sender, EventArgs e)
{
backgroundWorker1.Navigate("https://www.facebook.com/cocacola");
}
Can i detect when user click on the Like button ? For example when the user likes the page, a MessageBox appears and says that the page has been successfully liked !
Anyhelp would be highly appreciated

Categories

Resources