Breaking News
Saturday, 9 February 2013

How to apply letter validation in

This code user can not enter any digits and symbol in textbox  user anter only letters.

=> Create project.
=> take textbox from toolbox
=> select textbox and goto propeties window and click on event tab.
=> double click on KeyPress event.
=> write following code


 //this code is for when user enter any digit then it alllow to enter but when user enter any letters then it does not alloe to enter letters in textbox..
       private void txtSn_KeyPress(object sender, KeyPressEventArgs e)
            if (!char.IsLetter(e.KeyChar) && !char.IsControl(e.KeyChar))

/\/ir@\/  <(.'.)>


Post a Comment

Thanks for comment

Toggle Footer