-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
49 lines (41 loc) · 1.11 KB
/
Form1.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
using System;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
namespace AgeCalculator
{
// 主窗体
public partial class Form1 : Form
{
private long Age;
public Form1()
{
InitializeComponent();
}
private void buttonClick1_GetAge(object sender, EventArgs e)
{
// 将值传入子窗口 Form2
Form2 form2 = new Form2(Age);
form2.ShowDialog();
}
private void Form1_Load(object sender, EventArgs e)
{
// throw new System.NotImplementedException();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
Age = 0;
try
{
Age = Convert.ToInt64(textBox1.Text);
}
catch (Exception exception)
{
// Console.WriteLine(exception);
// throw;
}
// throw new System.NotImplementedException();
}
}
// 结果显示窗口
}