public class NumericTextBox : TextBox
protected override void OnKeyPress(KeyPressEventArgs e)
{
if (!char.IsDigit(e.KeyChar))
{
e.Handled = true;
}
if (!Char.IsDigit(e.KeyChar))
{
e.Handled = true;
}
}
public class NumericTextBox : TextBox
protected override void OnKeyPress(KeyPressEventArgs e)
{
if (!char.IsDigit(e.KeyChar))
{
e.Handled = true;
}
if (!Char.IsDigit(e.KeyChar))
{
e.Handled = true;
}
}
转载于:https://www.cnblogs.com/yuan-shi-bu-luo/archive/2008/10/12/1308883.html