private void accessPoint_OnLostConnection() { accessPoint.Close(); DisableThisForm(); var dialog = new CouldNotConnectError(accessPoint); dialog.FormClosed += (x, y) => EnableThisForm(); dialog.ShowDialog(); refreshConnectionDependentComponents(); }