-1
private void browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
    {
        addressbar.Text = browser.Address;
    }

I have no idea why this is breaking.

1 Answers1

0

When you have multiple threads (UI thread and others), this problem will happen when you want to manipulate an object from a thread, and that object is created by another thread. You must use Invoke Method:

private void browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
{
    
    changeAddressBar(browser.Address)
}

void changeAddressBar(string txt){
     if (addressbar.InvokeRequired)
            addressbar.Invoke(new Action<string>(changeAddressBar), txt);
        else
            addressbar.Text= txt;
}
Farzin Kanzi
  • 3,380
  • 2
  • 21
  • 23