|
-
Jun 15th, 2000, 10:42 PM
#1
Thread Starter
New Member
Ok, I want to type letters and numbers on the key board and
have the ascii code come up in the text box, instead of text.
This is as close as I can get:
_______________________________________________
Private Sub Text1_KeyPress(KeyAscii As Integer)
Text1.Text = Text1.Text & KeyAscii
End Sub
________________________________________________
The "Text1.Text & KeyAscii" was just to get sequential characters in the text box.
Notice that:
mike becomes, ekim109105107101
Three problems:
1) If I type the word "mike", it comes out backwards(ascii included).
2) I only want ascii not letters and not in reverse order.
3) Things get worse when I try to use the "enter" key.
If you create a simple textbox and cut and past the above code, you will see exactly what I mean.
Thank's for any help!
-
Jun 15th, 2000, 10:49 PM
#2
Fanatic Member
haven't tried it but something like
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
Text1.Text = Text1.Text & cStr(KeyAscii)
KeyAscii = 0
End Sub
Iain, thats with an i by the way!
-
Jun 15th, 2000, 10:52 PM
#3
Frenzied Member
Try this;
Private Sub Text1_KeyPress(KeyAscii As Integer)
Text1.SelText = KeyAscii
KeyAscii = 0
End Sub
You have to set KeyAscii to 0 to stop the actual letter you pressed appearing..
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Jun 15th, 2000, 11:17 PM
#4
Thread Starter
New Member
Thanks, that really helped.
But what about using the Enter key to start on a new line (My text box is set for multiline).
If Ascii (13) shows up thats OK, But I still would like to start a new line instead of miles of Ascii on a single line.
Thank's
-
Jun 15th, 2000, 11:18 PM
#5
Fanatic Member
If KeyAscii = 13 then don't set it to zero.
Iain, thats with an i by the way!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|