UCLEDSet.cs
1.29 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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UserCtrlsByDXC
{
public partial class UCLEDSet : UserControl
{
public UCLEDSet()
{
InitializeComponent();
}
private void tBip_Leave(object sender, EventArgs e)
{
TextBox tb = sender as TextBox;
Label lb = this.Controls.Find(string.Format("lb{0}", tb.Name.Substring(2)), false)[0] as Label;
if (!OtherHelper.ValidateUserInput(tb.Text.Trim(), 24))
{
MessageBox.Show(string.Format("请输入正确的{0}!", lb.Text.Replace(":", "")));
tb.Focus();
return;
}
}
private void tBint_Leave(object sender, EventArgs e)
{
TextBox tb = sender as TextBox;
Label lb = this.Controls.Find(string.Format("lb{0}", tb.Name.Substring(2)), false)[0] as Label;
if (!OtherHelper.ValidateUserInput(tb.Text.Trim(), 2))
{
MessageBox.Show(string.Format("请输入正确的{0}!", lb.Text.Replace(":", "")));
tb.Focus();
return;
}
}
}
}