标签:winform c style class blog code
private void textBox1_KeyPress(object sender,KeyPressEventArgs e) { //数字0~9所对应的keychar为48~57 e.Handled = true; //输入0-9 if ((e.KeyChar >= 47 && e.KeyChar <= 58)) { e.Handled = false; } }
限制textBox的输入,只能输入数字
C# Winform textBox 只允许输入数字,布布扣,bubuko.com
标签:winform c style class blog code
原文地址:http://www.cnblogs.com/craigtao/p/3777527.html