private void UpdateControls() { try { btnBack.Enabled = BrowserControl.CanGoBack(); btnForward.Enabled = BrowserControl.CanGoForward(); } catch (NullReferenceException) { // Occurs if Windows are not created yet. } catch (Exception ex) { try { if (NewMessage != null) { NewMessage(this, ex.Message, this.GetBrowserIndex()); } } catch (NullReferenceException) { // Occurs if Windows are not created yet. } catch (Exception) { throw; } } }