by Sahacha (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 1st October 2002
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
converting ascii number to its character equivalent
On Error GoTo erhand
Label1.Caption = Chr(Text1.Text)
Exit Sub
erhand: 'on error erase text written in text1and in label 1
Text1.Text = Empty
Label1.Caption = Empty
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii 'prevent user from presing wrong keys
Case 48 To 57 ' numbers from 0 to 9
Case Else
KeyAscii = 0
End Select
End Sub