private void CheckLicence() { if (!Properties.Settings.Default.LicenceAccepted) { LicenceAgreementForm laf = new LicenceAgreementForm(); try { if (laf.ShowDialog() == DialogResult.Yes) { Properties.Settings.Default.LicenceAccepted = true; Properties.Settings.Default.Save(); } else { Close(); } } finally { laf.Dispose(); } } }