// Raises the NavigateError event.
 protected virtual void OnNavigateError(
     WebBrowserNavigateErrorEventArgs e)
 {
     if (this.NavigateError != null)
     {
         this.NavigateError(this, e);
     }
 }
 private void wb_NavigateError(
     object sender, WebBrowserNavigateErrorEventArgs e)
 {
     // Display an error message to the user.
     MessageBox.Show("Cannot navigate to " + e.Url);
 }