-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormClassic.cs
More file actions
71 lines (64 loc) · 2.12 KB
/
FormClassic.cs
File metadata and controls
71 lines (64 loc) · 2.12 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
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 vsGUI
{
public partial class FormClassic : Form
{
private Form currentForm;
public FormClassic()
{
InitializeComponent();
if (GlobalValue.globalLanguage) //初始化文本
{
buttonC1.Text = "龙舌兰日出";
buttonC2.Text = "蓝色夏威夷";
buttonC3.Text = "长岛冰茶";
}
}
//打开新窗口
private void OpenForm(Form childForm, object btnSender)
{
if (currentForm != null)
{
currentForm.Close();
}
currentForm = childForm;
childForm.TopLevel = false;
childForm.FormBorderStyle = FormBorderStyle.None;
childForm.Dock = DockStyle.Fill;
panel1.Controls.Add(childForm);
panel1.Tag = childForm;
childForm.BringToFront();
childForm.Show();
}
/// <summary>
/// 按钮监听,分别对应3种经典鸡尾酒
/// button C1~C3
/// </summary>
private void buttonC1_Click(object sender, EventArgs e)
{
GlobalValue.globalFormNumber = 4; //更新状态
GlobalValue.globalCocktailCode = "144252"; //将鸡尾酒代码写入全局变量
OpenForm(new FormClassicInfo1(), sender); //打开介绍页面
}
private void buttonC2_Click(object sender, EventArgs e)
{
GlobalValue.globalFormNumber = 5; //同上
GlobalValue.globalCocktailCode = "245262";
OpenForm(new FormClassicInfo2(), sender);
}
private void buttonC3_Click(object sender, EventArgs e)
{
GlobalValue.globalFormNumber = 6; //同上
GlobalValue.globalCocktailCode = "133342";
OpenForm(new FormClassicInfo3(), sender);
}
}
}