Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Kristian

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

ASCII Alt-Key Code Generator

//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
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS