//Name of textbox is textBox1 and event is KeyDownprivate void textBox1_KeyDown(object sender, KeyEventArgs e){ if (!((e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9) ||((e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9) && (!e.Shift)) ||e.KeyCode == Keys.Back || e.KeyCode == Keys.Delete || e.KeyCode ==Keys.Alt || e.KeyCode == Keys.Left || e.KeyCode == Keys.Right ||e.KeyCode == Keys.Shift || e.KeyCode == Keys.Home || e.KeyCode ==Keys.End || e.KeyCode == Keys.Decimal)) e.SuppressKeyPress = true;}
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: