项目上用到的,需要textbox只能输入数字,而且有最大值、最小值限制。
效果如图3所示,图4显示错误框在左边时离textbox有点远,需要时自己调。
using System;
using System.ComponentModel;
using System.Drawing;
using System.Text.RegularExpressions;
using System.Windows.Forms;namespace xxx.xxx.controls
{
public class RangTextBox : TextBox
{
[Category("自定义属性"), De