5 Replies - 4067 Views - Last Post: 22 February 2009 - 06:25 AM Rate Topic: -----

#1 qaz1134  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 121
  • Joined: 21-May 08

backspace Is Not working!

Posted 18 February 2009 - 10:44 AM

Hello every one I kinda have some trouble about the backspace thing...

I was trying to filter every input from the user so that he could only enter numbers by using this code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If IsNumeric(Chr(KeyAscii)) <> True Then KeyAscii = 0
End Sub


This code blocks any existing character input from the keyboard and accept numbers 0-9

the problem is the backspace thing is also block :ohno: and i do not know any other syntax..

please help me ^_^

Is This A Good Question/Topic? 0
  • +

Replies To: backspace Is Not working!

#2 n8wxs  Icon User is offline

  • --... ...-- -.. . -. ---.. .-- -..- ...
  • member icon

Reputation: 971
  • View blog
  • Posts: 3,878
  • Joined: 07-January 08

Re: backspace Is Not working!

Posted 18 February 2009 - 04:50 PM

Have a look at the example code for the Control.KeyDown Event
Was This Post Helpful? 0
  • +
  • -

#3 luigiplumbersinc  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 82
  • Joined: 16-February 09

Re: backspace Is Not working!

Posted 18 February 2009 - 04:50 PM

View Postqaz1134, on 18 Feb, 2009 - 09:44 AM, said:

Hello every one I kinda have some trouble about the backspace thing...

I was trying to filter every input from the user so that he could only enter numbers by using this code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If IsNumeric(Chr(KeyAscii)) <> True Then KeyAscii = 0
End Sub


This code blocks any existing character input from the keyboard and accept numbers 0-9

the problem is the backspace thing is also block :ohno: and i do not know any other syntax..

please help me ^_^


as i recall the value the backspace key passes to KeyAscii is 8 so this should do the trick
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 Then
If IsNumeric(Chr(KeyAscii)) <> True Then KeyAscii = 0
End If
End Sub


This post has been edited by luigiplumbersinc: 18 February 2009 - 04:50 PM

Was This Post Helpful? 1
  • +
  • -

#4 qaz1134  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 121
  • Joined: 21-May 08

Re: backspace Is Not working!

Posted 22 February 2009 - 04:46 AM

View Postn8wxs, on 18 Feb, 2009 - 03:50 PM, said:

Have a look at the example code for the Control.KeyDown Event



The Site that you gave me seems to be broken OR something that I cannot view because of some sort of problem

thanks for Helping :)
Was This Post Helpful? 0
  • +
  • -

#5 Rezert  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 71
  • Joined: 17-August 08

Re: backspace Is Not working!

Posted 22 February 2009 - 06:11 AM

Seems to work for me. Try going through a proxy? www.rtunnel.com
Was This Post Helpful? 0
  • +
  • -

#6 qaz1134  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 121
  • Joined: 21-May 08

Re: backspace Is Not working!

Posted 22 February 2009 - 06:25 AM

View PostRezert, on 22 Feb, 2009 - 05:11 AM, said:

Seems to work for me. Try going through a proxy? www.rtunnel.com




Thanks for helping But I kindda tried that one Too. ^_^
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1