-
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!
-
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
-
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..
-
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
-
If KeyAscii = 13 then don't set it to zero.