private void txtCompanyName_KeyPress(object sender, KeyPressEventArgs e) { try { int ascii = e.KeyChar; DataValidator.AllowOnlyCharacter(ascii, e); } catch (Exception exc) { Utill.Common.ExceptionLogger.writeException("Customer-List", exc.StackTrace); MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception"); } }
private void txtValue_KeyPress(object sender, KeyPressEventArgs e) { if (cmbApply.SelectedIndex > 0) { if (cmbApply.SelectedIndex == 1 || cmbApply.SelectedIndex == 2) { DataValidator.AllowOnlyNumeric(e, "."); } else { int ascii = e.KeyChar; DataValidator.AllowOnlyCharacter(ascii, e); } } }
private void txtFromentryno_KeyPress(object sender, KeyPressEventArgs e) { int ascii = e.KeyChar; DataValidator.AllowOnlyCharacter(ascii, e); }