visual C# 简单问题,在线等^^^

来源:百度知道 编辑:UC知道 时间:2024/05/22 16:47:40
在"textBox1_TextChanged"控件里添加什么代码可限制控件里只输入"int"整型数.
非常感谢!!

private void TextBox1_KeyPress(object sender,System.Windows.Forms.KeyPressEventArgs e)
{
if(!Char.IsNumber(e.KeyChar))
e.Handled=true;
}

楼上正解。
呵呵。
来晚了,没抢上。