-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChooseTemplateForm.cs
58 lines (53 loc) · 1.53 KB
/
ChooseTemplateForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Assignment_2
{
public partial class Choose_Template_Form : Form
{
public InputForm input;
public Choose_Template_Form()
{
InitializeComponent();
}
private void pictureBox_Template1_Click(object sender, EventArgs e)
{
input = new InputForm("Template1");
input.Show(this);
this.Hide();
}
private void pictureBox_Template2_Click(object sender, EventArgs e)
{
input = new InputForm("Template2");
input.Show(this);
this.Hide();
}
private void Form_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)
{
if (MessageBox.Show("Are you sure you want to Proceed!!", "All data will be lost!!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
{
e.Cancel = false;
}
else
{
e.Cancel = true;
}
}
}
private void Choose_Template_Form_FormClosed(object sender, FormClosedEventArgs e)
{
if (input != null)
{
input.Close();
}
}
}
}