narasiman man

narasiman man

  • NA
  • 0
  • 118.3k

validation

Jul 3 2012 3:12 AM


 i post a question i have one field loan in that i have to type only numbers not characters.

Loan 1000.

you posted answers as follows

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
  {
 
  if (!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "\\d+"))

  e.Handled = true;
  }

in that i click  a loan text box

private void txt_loan_TextChanged(object sender, EventArgs e)

only text changed only there.not key press event.


what to do. 

above one i am creating in vb.net using csharp. it is a window application.help me wat to do.

Regards,
Narasiman P



Answers (2)