By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,057 Members | 1,407 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,057 IT Pros & Developers. It's quick & easy.

textbox control

P: 1
set textbox only entered text but i can't use backspace please send me

solution.
Dec 14 '07 #1
Share this Question
Share on Google+
2 Replies


debasisdas
Expert 5K+
P: 8,127
You need to handle keycode 8 ( for backspace)
Dec 14 '07 #2

P: 1
Type this code in the KeyPress event of the text box. I'll give you a sample coding of it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub txtPassword_KeyPress(KeyAscii As Integer)
  2. Dim KeyChar As String
  3. If KeyAscii > 31 Then (ignore low-ASCII characters like BACKSPACE)
  4.   KeyChar = Chr(KeyAscii)
  5.   If Not IsNumeric(KeyChar) Then
  6.     KeyAscii = 0
  7.   End If
  8. End If
  9. End Sub
Dec 16 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.