473,320 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

KeyAscii code problem

7
Hi,
I done program in that i don't want backspace button active in that case i done coading it is working fine in textbox & now i want to use in richtextbox but how?
following is my code

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then KeyAscii = 0
End Sub

Thanks in advance.
Jul 11 '07 #1
3 2068
r035198x
13,262 8TB
Hi,
I done program in that i don't want backspace button active in that case i done coading it is working fine in textbox & now i want to use in richtextbox but how?
following is my code

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then KeyAscii = 0
End Sub

Thanks in advance.
Looks like VB to me.
Moved
Jul 11 '07 #2
kadghar
1,295 Expert 1GB
Hi,
I done program in that i don't want backspace button active in that case i done coading it is working fine in textbox & now i want to use in richtextbox but how?
following is my code

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then KeyAscii = 0
End Sub

Thanks in advance.
Try in the Text3_KeyDown Sub, write

if KeyCode=8 then KeyCode=0

im not sure why the backspace works only there, but im sure there's a logic explanation.

Hope that helps.
Jul 11 '07 #3
cmrhema
375 256MB
Hi,
I done program in that i don't want backspace button active in that case i done coading it is working fine in textbox & now i want to use in richtextbox but how?
following is my code

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then KeyAscii = 0
End Sub

Thanks in advance.

Try out this
Private Sub RichTextBox1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
SendKeys "^+z"
Exit Sub
End If
End Sub
Jul 12 '07 #4

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

Similar topics

6
by: margetts | last post by:
Hey there, what i want to do is have a text field that can only accept numbers, full stops and the backspace key. I currently have the below code to accept only numbers, but no full stops or...
4
by: laurenq uantrell | last post by:
In a field's OnKeyPress properties I can execute code that reveals the Ascii key that is pressed: On Key Press: Private Sub FieldName_KeyPress(KeyAscii As Integer) Dim x as Integer If...
1
by: laurenq uantrell | last post by:
In a field's OnKeyPress properties I can execute code that reveals the Ascii key that is pressed: On Key Press: Private Sub FieldName_KeyPress(KeyAscii As Integer) Dim x as Integer If...
2
by: ahmedazzam | last post by:
I need to know Keyascii for different keys
4
by: HelloWorldHelloWorldHello | last post by:
What i want to know is What is the KeyAscii of " "Tab" key" ?.
1
by: HelloWorldHelloWorldHello | last post by:
Can Anyone Tell Me How to direct KeyAscii with using CommandButton Only.?
1
by: HelloWorldHelloWorldHello | last post by:
How to use KeyAscii without any KeyPress(text1_Keypress).? But CommandButton can direct the KeyAscii only.
1
by: Asad Asad | last post by:
Please tell me what is the KeyAscii value of Window Key
7
by: raghunadhs | last post by:
with help of key press evnt i am able to find the KeyAscii values.. but i am unable to find the ascii values of "delete","home","pageUp", ...etc.. In my application there is a need to find...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.