private void controls_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar != 8 && !char.IsDigit(e.KeyChar)) e.Handled = true; }