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

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

ASCII Alt-Key Code Generator

//Code for an ASCII Alt-Key code generator

   1  
   2  Option Explicit
   3      Dim CurCharacter As String              
   4      Dim Code As Integer
   5      
   6  Private Sub cmdTranslate_Click()
   7      Call Translate
   8      Call Output
   9  End Sub
  10  
  11  
  12  Private Sub txtEnter_Change()               
  13      If txtEnter.Text = "" Then
  14          cmdTranslate.Enabled = False
  15      Else
  16          cmdTranslate.Enabled = True
  17      End If
  18  End Sub
  19  
  20  Private Function Translate()                
  21      CurCharacter = txtEnter.Text
  22      Code = Asc(CurCharacter)
  23  End Function
  24  
  25  Private Function Output()                   
  26      txtTranslation.Text = "Alt + " & Code
  27      txtEnter.SetFocus
  28  End Function
  29  
  30  Private Sub txtEnter_KeyDown(KeyCode As Integer, Shift As Integer)
  31      If (KeyCode = 13) And (cmdTranslate.Enabled = True) Then
  32          Call Translate
  33          Call Output
  34      ElseIf Not KeyCode = 13 Then
  35      Else
  36          txtTranslation.Text = "NO INPUT"
  37      End If
  38  End Sub
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS