Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.MainForm.Test/3.2/EditorView.cs @ 2299

Last change on this file since 2299 was 2266, checked in by mkommend, 15 years ago

added ability to cancel form close;
removed mistakenly commited csproj.user file (ticket #716)

File size: 932 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Drawing;
5using System.Data;
6using System.Linq;
7using System.Text;
8using System.Windows.Forms;
9
10namespace HeuristicLab.MainForm.Test {
11  public partial class EditorView : ViewBase {
12    public EditorView() {
13      InitializeComponent();
14    }
15
16    public EditorView(IMainForm mainform)
17      : base(mainform) {
18    }
19
20    private void ChangeStateButton_Click(object sender, EventArgs e) {
21      this.OnStateChanged();
22    }
23
24    public override void FormClosing(object sender, FormClosingEventArgs e) {
25      if (DialogResult.Yes != MessageBox.Show(
26             "Recent changes have not been saved. Close the editor anyway?", "Close editor?",
27              MessageBoxButtons.YesNo, MessageBoxIcon.Question,
28              MessageBoxDefaultButton.Button2)) {
29
30        e.Cancel = true;
31
32      }
33    }
34  }
35}
Note: See TracBrowser for help on using the repository browser.