-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormClassicInfo2.cs
More file actions
76 lines (70 loc) · 2.05 KB
/
FormClassicInfo2.cs
File metadata and controls
76 lines (70 loc) · 2.05 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
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace vsGUI
{
public partial class FormClassicInfo2 : Form
{
private Form currentForm;
public FormClassicInfo2()
{
InitializeComponent();
if (GlobalValue.globalLanguage) //初始化文本
{
buttonC1.Text = "蓝色夏威夷";
labelInfoEN.Visible = false;
}
else
{
labelInfoCN.Visible = false;
}
}
//打开新窗口
public 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();
}
//确认键监听
private void buttonYes_Click(object sender, EventArgs e)
{
if (GlobalValue.globalIsPortOpening == true)
{
GlobalValue.globalCocktailCode = "245262";
GlobalMethod.PortSend("checkP");
buttonYes.Visible = false;
//等待3秒,否则超时,需重新点击按钮
for (int i = 0; i < 3; i++)
{
Thread.Sleep(1000);
if (GlobalValue.globalBartending)
{
OpenForm(new FormBF(), sender);
}
}
buttonYes.Visible = true;
}
else
{
MessageBox.Show("Port is not open!");
}
}
}
}