private void txtamount_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (e.KeyValue >= 48 && e.KeyValue <= 57 || e.KeyValue == 17|| e.KeyValue == 20 || e.KeyValue == 92 || e.KeyValue == 46 || e.KeyValue == 45 || e.KeyValue == 18 || e.KeyValue == 91 || e.KeyValue == 32 || e.KeyValue == 93 || e.KeyValue == 16 || e.KeyValue == 13 || e.KeyValue == 8 || e.KeyValue == 33 || e.KeyValue == 34 || e.KeyValue == 35 || e.KeyValue == 36 || e.KeyValue == 37 || e.KeyValue == 38 || e.KeyValue == 39 || e.KeyValue == 40 || e.KeyValue == 27 || e.KeyValue == 144 || e.KeyValue == 96 || e.KeyValue == 97 || e.KeyValue == 98 || e.KeyValue == 99 || e.KeyValue == 100 || e.KeyValue == 101 || e.KeyValue == 102 || e.KeyValue == 103 || e.KeyValue == 104 || e.KeyValue == 105 || e.KeyValue == 106 || e.KeyValue == 107 || e.KeyValue == 108 || e.KeyValue == 109 || e.KeyValue == 110 || e.KeyValue == 111 || e.KeyValue == 112 || e.KeyValue == 113 || e.KeyValue == 114 || e.KeyValue == 115 || e.KeyValue == 116 || e.KeyValue == 117 || e.KeyValue == 118 || e.KeyValue == 119 || e.KeyValue == 120 || e.KeyValue == 121 || e.KeyValue == 22 || e.KeyValue == 123 || e.KeyValue == 145 || e.KeyValue == 19)
{
}
else
{
if (e.Alt && e.KeyCode == Keys.N || e.Alt && e.KeyCode == Keys.S || e.Alt && e.KeyCode == Keys.E || e.Alt && e.KeyCode == Keys.C)
{
}
else
{
MessageBox.Show("Ooops! Only numeric allowed.", "School Charge Master", MessageBoxButtons.OK, MessageBoxIcon.Warning);
try
{
txtamount.Text = "";
txtamount.Focus();
}
catch (Exception)
{ }
}
}
}
catch
{
}
}
this is for (.) allow e.KeyValue == 190