-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChooseDataAreaWindow.cs
More file actions
38 lines (35 loc) · 1.19 KB
/
Copy pathChooseDataAreaWindow.cs
File metadata and controls
38 lines (35 loc) · 1.19 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
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace PrizeDrawTool
{
public partial class ChooseDataAreaWindow : Form
{
public ChooseDataAreaWindow()
{
InitializeComponent();
MainWindow.workSheetID = 0;
}
private void AreaConfirmBtn_Click(object sender, EventArgs e)
{
string from = this.AreaFromTB.Text;
string to = this.AreaToTB.Text;
string pattern = @"^[a-zA-Z]+[0-9]+$";
if (Regex.IsMatch(from, pattern) && Regex.IsMatch(to, pattern) || (from == string.Empty && to == string.Empty))
{
this.DialogResult = DialogResult.OK;
this.Close();
}
else
{
this.AreaFromTB.Text = string.Empty;
this.AreaToTB.Text = string.Empty;
MessageBox.Show("请输入合理的范围!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
private void WorkSheetListBox_SelectedIndexChanged(object sender, EventArgs e)
{
MainWindow.workSheetID = this.WorkSheetListBox.SelectedIndex;
}
}
}