Naeem Khan

Naeem Khan

  • 789
  • 782
  • 790.6k

problem in cs file for validation

Dec 3 2009 3:26 AM
hello every one, i have very big problem . i want to create cs file for validation where i can make function for numeric validation and character validation when i m created its give me error i m sending u what kind of function i m making on there please check it and reply me if u know easy way to do same thing then plz let me know.......... code// using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace ContaxSoftware { class Validation { public void price_validation(object sender, KeyPressEventArgs e) { int num = e.KeyChar; if (e.KeyChar == '.' || num == 8) { e.Handled = false; } else if (!char.IsDigit(e.KeyChar)) { e.Handled = true; } } thanks in Advcance

Answers (4)