private void BaseForm_FormClosing(object sender, FormClosingEventArgs e) { if (NextForm != null || SkipSaveFile) { return; } if (AppDataRepository.YoutubeKey == null) { return; } var result = MessageBox.Show("Хотите сохранить внесенные изменения?", "Сохранение", MessageBoxButtons.YesNoCancel); switch (result) { case DialogResult.Yes: AppDataRepository.Save(); break; case DialogResult.No: break; default: e.Cancel = true; break; } PreviousForm?.Close(); }
protected void backButton_Click(object sender, EventArgs e) { Hide(); PreviousForm.Show(); PreviousForm.NextForm = null; SkipSaveFile = true; Close(); }
public virtual void BackButton_Click(object sender, EventArgs e) { PreviousForm.Show(); this.Hide(); }