private void txtRate_KeyPress(object sender, KeyPressEventArgs e) { TextBoxValidation val = new TextBoxValidation(); val.onlyNumber(sender, e); if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar != '.')) { e.Handled = true; } }
private void txtAmt_KeyPress(object sender, KeyPressEventArgs e) { TextBoxValidation val = new TextBoxValidation(); val.onlyNumber(sender, e); }