KeyPress事件的使用
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar != 8 && !char.IsDigit(e.KeyChar))
{
this.Text = e.KeyChar.ToString();
e.Handled = True;
}
}
KeyPress事件的使用
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar != 8 && !char.IsDigit(e.KeyChar))
{
this.Text = e.KeyChar.ToString();
e.Handled = True;
}
}