private void AmountPaytextBox_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { e.Handled = true; AmounterrorProvider.SetError(this.AmountPaytextBox, "Only Numeric value is valid as Amount"); } else { AmounterrorProvider.Clear(); } }
private void AmountPaytextBox_Leave(object sender, EventArgs e) { if (AmountPaytextBox.Text == string.Empty) { AmounterrorProvider.SetError(this.AmountPaytextBox, "Lowest Pay amount is 1000tk"); } else if (int.Parse(AmountPaytextBox.Text) < 1000) { AmounterrorProvider.SetError(this.AmountPaytextBox, "Lowest Pay amount is 1000tk"); } else { AmounterrorProvider.Clear(); } }