//Code for an ASCII Alt-Key code generator
Option Explicit
Dim CurCharacter As String
Dim Code As Integer
Private Sub cmdTranslate_Click()
Call Translate
Call Output
End Sub
Private Sub txtEnter_Change()
If txtEnter.Text = "" Then
cmdTranslate.Enabled = False
Else
cmdTranslate.Enabled = True
End If
End Sub
Private Function Translate()
CurCharacter = txtEnter.Text
Code = Asc(CurCharacter)
End Function
Private Function Output()
txtTranslation.Text = "Alt + " & Code
txtEnter.SetFocus
End Function
Private Sub txtEnter_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode = 13) And (cmdTranslate.Enabled = True) Then
Call Translate
Call Output
ElseIf Not KeyCode = 13 Then
Else
txtTranslation.Text = "NO INPUT"
End If
End Sub