|
-
Aug 13th, 2000, 04:13 AM
#1
Thread Starter
Lively Member
Hi everyone,
I have tried a sample code in a form with 2 buttons and 3 textfields:
Private Sub Command1_Click()
Text3.Text = Asc(Text1.Text)
End Sub
Private Sub Command2_Click()
If Text3.Text > 31 Then
Text2.Text = Chr(Text3.Text)
Else
Text2.Text = ChrB(Text3.Text)
End If
End Sub
This should work, but when i put in Text3 a value under 31, in Text2 nothing appears. Can you help me please?
-
Aug 13th, 2000, 05:28 AM
#2
not surprising really, Ascii char 31 is not supported by windows, in other words some fonts will show nothing.
install the MSDN library if you havent already and use it: go to the index and type "Ascii Character Codes", and you'll get a map of them.
-
Aug 13th, 2000, 06:28 AM
#3
Thread Starter
Lively Member
Bad thing!
Ahi ahi... this is a bad thing... any idea on how to solve this problem?
-
Aug 13th, 2000, 08:56 AM
#4
It's best to stay away from character's 0-31 and 127-159.
-
Aug 13th, 2000, 09:09 AM
#5
Monday Morning Lunatic
It's in the VB5 help file (at least). Also, try Character Map for all the characters 32->256.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 13th, 2000, 09:35 AM
#6
Parksie: You are forgetting characters 127-159 are not supported by Windows
Override:
Code:
If Not (Asc(Text1) > 32 And Asc(Text1) < 127) Or Asc(Text1) > 159 Then
'Key is invalid
End If
-
Aug 13th, 2000, 09:39 AM
#7
Monday Morning Lunatic
Strange. Then how come in Character Map, when selecting Times New Roman, I have a total of 224 characters displayed?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 13th, 2000, 10:19 AM
#8
Yes, actually you're right, but 127-159, for the most part, are only supported with TTF. If you try it with a Non-TTF (which includes the standard MS Sans Serif) then chances are it won't work.
-
Aug 13th, 2000, 10:28 AM
#9
Monday Morning Lunatic
Hmm. It's got characters for those as well! I tried MS Sans Serif, MS Serif, Terminal, Fixedsys and some others and they all had those characters supported. Although most of them missed 127->159 out. The chars from 160->255 seemed to be stuff like é and ô.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 13th, 2000, 11:35 AM
#10
Thread Starter
Lively Member
That's strange, i have tried chars beetween 127 - 159 and
actually they don't give me any kind of problem. They work
well, i am using Terminal Font.
Just another question:
I have to send to a multiline textfield a simulation of an
Enter keystroke.
If i want to add a simple character then i do
Text1.Text + "a"
but how to send a enter keystroke?
Text1.Text + ENTER
Does not work! Eheh! ;-)))
-
Aug 13th, 2000, 04:48 PM
#11
For ENTER use:
Code:
'Either this
Text1.Text = Text1.Text & vbNewLine
'Or this
Text1.Text = Text1.Text & vbCrLf
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
|