frmCharacter.frm

 VERSION 5.00
Begin VB.Form frmCharacter
   BackColor       =   &H8000000D&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Character Converter"
   ClientHeight    =   4590
   ClientLeft      =   3000
   ClientTop       =   1545
   ClientWidth     =   6150
   Icon            =   "frmCharacter.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4590
   ScaleWidth      =   6150
   Begin VB.Timer Timer1
      Interval        =   500
      Left            =   2520
      Top             =   2040
   End
   Begin VB.TextBox Text1
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF00FF&
      Height          =   735
      Left            =   2468
      TabIndex        =   0
      Top             =   960
      Width           =   1215
   End
   Begin VB.CommandButton cmdAnsi
      BackColor       =   &H00C0FFC0&
      Caption         =   "&ASCII"
      Height          =   495
      Left            =   4680
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   2880
      Width           =   1215
   End
   Begin VB.CommandButton cmdCharacter
      BackColor       =   &H00FFFF80&
      Caption         =   "&CHARACTER"
      Height          =   495
      Left            =   240
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   2880
      Width           =   1215
   End
   Begin VB.CommandButton cmdExit
      BackColor       =   &H008080FF&
      Caption         =   "E&xit"
      Height          =   495
      Left            =   4680
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   3960
      Width           =   1215
   End
   Begin VB.CommandButton cmdAbout
      BackColor       =   &H0080FFFF&
      Caption         =   "A&bout"
      Height          =   495
      Left            =   240
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   3960
      Width           =   1215
   End
   Begin VB.Label Label2
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFC0&
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   735
      Left            =   240
      TabIndex        =   8
      Top             =   1920
      Width           =   1215
   End
   Begin VB.Label Label3
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFC0&
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   735
      Left            =   4680
      TabIndex        =   7
      Top             =   1920
      Width           =   1215
   End
   Begin VB.Image Image1
      Height          =   975
      Left            =   2528
      Picture         =   "frmCharacter.frx":0442
      Stretch         =   -1  'True
      Top             =   3120
      Width           =   1095
   End
   Begin VB.Label Label4
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "LARKANA GROUP"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF00FF&
      Height          =   255
      Left            =   1988
      TabIndex        =   6
      Top             =   4200
      Width           =   2175
   End
   Begin VB.Label Label1
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Please type a character(s) you want to convert."
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   375
      Left            =   360
      TabIndex        =   5
      Top             =   240
      Width           =   5415
   End
   Begin VB.Menu mnuFile
      Caption         =   "&File"
      Begin VB.Menu mnuAnsi
         Caption         =   "&Ascii"
         Shortcut        =   ^A
      End
      Begin VB.Menu mnuCharacter
         Caption         =   "&Character"
         Shortcut        =   ^C
      End
      Begin VB.Menu mnuExit
         Caption         =   "E&xit"
         Shortcut        =   ^X
      End
   End
   Begin VB.Menu mnuUtilities
      Caption         =   "&Utilities"
      Begin VB.Menu mnuTable
         Caption         =   "Table&One"
         Shortcut        =   {F2}
      End
      Begin VB.Menu mnuTableTwo
         Caption         =   "Table&Two"
         Shortcut        =   {F3}
      End
   End
   Begin VB.Menu mnuHelp
      Caption         =   "&Help"
      Begin VB.Menu mnuUsage
         Caption         =   "How to &Use"
         Shortcut        =   {F1}
      End
      Begin VB.Menu mnuAbout
         Caption         =   "&About"
         Shortcut        =   ^B
      End
   End
End
Attribute VB_Name = "frmCharacter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdAbout_Click()
frmAbout.Show vbModal
End Sub

Private Sub cmdAnsi_Click()



If Text1 = "" Then
MsgBox "Please type in a single character.", vbCritical
Label3.Caption = ""
Text1.SetFocus
Else
Text1.Enabled = True

Label3 = Asc(Text1.Text)

End If
End Sub

Private Sub cmdCharacter_Click()

If IsNumeric(Text1.Text) = True Then

On Error GoTo Errorfixer


Label2 = Chr(Text1.Text)
Else
MsgBox "Please type in any of the numbers below 256.", vbCritical
Label2.Caption = ""
Text1.SetFocus
End If

If Text1 > "255" Then
If Text1 = "" Then
MsgBox "Please type in any of the numbers below 256.", vbCritical
Label2.Caption = ""
Text1.SetFocus
End If
End If

Errorfixer:
If Err.Number = "5" Then
Label2 = ""
Text1 = ""
MsgBox "Please type in any of the numbers below 256.", vbCritical, "Data entry error"
Text1.SetFocus
End If

End Sub

Private Sub cmdExit_Click()
End
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Unload frmTableOne
Unload frmTableTwo
End Sub

Private Sub mnuAbout_Click()
cmdAbout_Click
End Sub

Private Sub mnuAnsi_Click()
Call cmdAnsi_Click

End Sub

Private Sub mnuCharacter_Click()
Call cmdCharacter_Click
End Sub

Private Sub mnuExit_Click()
End
End Sub

Private Sub mnuTable_Click()
frmTableOne.Show
End Sub

Private Sub mnuTableTwo_Click()
frmTableTwo.Show
End Sub

Private Sub mnuUsage_Click()
frmHelp.Show vbModal
End Sub

Private Sub Text1_Change()
Text1.MaxLength = 3
End Sub

Private Sub Timer1_Timer()
Static Sarfraz As Integer

If Sarfraz = 0 Then
Label4.ForeColor = vbBlue
Sarfraz = 1
Exit Sub

ElseIf Sarfraz = 1 Then
Label4.ForeColor = vbWhite
Sarfraz = 2
Exit Sub

ElseIf Sarfraz = 2 Then
Label4.ForeColor = vbGreen
Sarfraz = 3
Exit Sub

ElseIf Sarfraz = 3 Then
Label4.ForeColor = vbMagenta
Sarfraz = 4
Exit Sub

ElseIf Sarfraz = 4 Then
Label4.ForeColor = vbRed
Sarfraz = 5
Exit Sub

ElseIf Sarfraz = 5 Then
Label4.ForeColor = vbCyan
Sarfraz = 6
Exit Sub

ElseIf Sarfraz = 6 Then
Label4.ForeColor = vbGreen
Sarfraz = 0
Exit Sub
End If

End Sub

Project Homepage: