I want to get the current address and basically put it in a textbox. I found this link but can't seem to understand anything.
http://cefsharp.github.io/api/57.0.0/html/P_CefSharp_WinForms_ChromiumWebBrowser_Address.htm
I would really appreciate a code snippet from someone. It's killing me. i'm using WFA.
You have to listen to below address change event and persists it yourself.
this.Browser = new ChromiumWebBrowser();
this.Browser.AddressChanged += Browser_AddressChanged;
private void Browser_AddressChanged(object sender, AddressChangedEventArgs e)
{
this.CurrentAddress = e.Address;
}
The browser object exposes the address using the property Address:
var browser = new ChromiumWebBrowser(...);
var currentAddress = browser.Address;
I'm using version 71 and the method:
TextBox1.Text = browser.Address;
Seems to work. Try updating to 71 and see if that helps, if you still have a problem with this.
"browser" is obviously the CefSharp browser control I've added programmatically. If you don't know how to do this, it's merely the following:
CefSharp.WinForms.ChromiumWebBrowser browser = new CefSharp.WinForms.ChromiumWebBrowser("https://google.com/");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With