| Author: chandramohan 04 Aug 2008 | Member Level: Gold | Rating: Points: 4 |
if e.KeyChar = " " then exit Sub If Asc(e.KeyChar) < 48 Then e.Handled = True ElseIf Asc(e.KeyChar) > 57 And Asc(e.KeyChar) < 65 Then e.Handled = True ElseIf Asc(e.KeyChar) > 95 And Asc(e.KeyChar) < 97 Then e.Handled = True ElseIf Asc(e.KeyChar) > 122 Then e.Handled = True End If
|
| Author: chandramohan 04 Aug 2008 | Member Level: Gold | Rating: Points: 2 |
http://www.c-sharpcorner.com/UploadFile/scottlysle/UseErrorProvider03082007210138PM/UseErrorProvider.aspx
|
| Author: UltimateRengan 04 Aug 2008 | Member Level: Diamond | Rating: Points: 4 |
hi, its working fine.i hope this may help u
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) {
if (((e.KeyChar < '0') || (e.KeyChar > '9')) && (e.KeyChar != '\b')) { } else { e.Handled = true; } }
UltimateRengan nathan.rengan@gmail.com Trichy-Rider Group
|