home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / keycod1a / frmcodes.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-10-08  |  2.9 KB  |  102 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4680
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   3195
  10.    ScaleWidth      =   4680
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CheckBox Check1 
  13.       Caption         =   "Grab code from next key pushed"
  14.       Height          =   615
  15.       Left            =   2640
  16.       TabIndex        =   2
  17.       Top             =   960
  18.       Width           =   1215
  19.    End
  20.    Begin VB.CommandButton Command2 
  21.       Caption         =   "Save Codes"
  22.       Height          =   495
  23.       Left            =   2640
  24.       TabIndex        =   4
  25.       Top             =   480
  26.       Width           =   1215
  27.    End
  28.    Begin VB.CommandButton Command1 
  29.       Caption         =   "Add Code"
  30.       Height          =   495
  31.       Left            =   2640
  32.       TabIndex        =   3
  33.       Top             =   0
  34.       Width           =   1215
  35.    End
  36.    Begin VB.ListBox List2 
  37.       Height          =   2790
  38.       ItemData        =   "FrmCodes.frx":0000
  39.       Left            =   1320
  40.       List            =   "FrmCodes.frx":0002
  41.       TabIndex        =   5
  42.       TabStop         =   0   'False
  43.       Top             =   360
  44.       Width           =   1215
  45.    End
  46.    Begin VB.ListBox List1 
  47.       Height          =   2790
  48.       ItemData        =   "FrmCodes.frx":0004
  49.       Left            =   0
  50.       List            =   "FrmCodes.frx":0006
  51.       TabIndex        =   6
  52.       TabStop         =   0   'False
  53.       Top             =   360
  54.       Width           =   1215
  55.    End
  56.    Begin VB.TextBox Text1 
  57.       Height          =   285
  58.       Left            =   0
  59.       TabIndex        =   1
  60.       Top             =   0
  61.       Width           =   1215
  62.    End
  63.    Begin VB.Label Label1 
  64.       Height          =   255
  65.       Left            =   1320
  66.       TabIndex        =   0
  67.       Top             =   0
  68.       Width           =   1215
  69.    End
  70. Attribute VB_Name = "Form1"
  71. Attribute VB_GlobalNameSpace = False
  72. Attribute VB_Creatable = False
  73. Attribute VB_PredeclaredId = True
  74. Attribute VB_Exposed = False
  75. Private Sub Check1_Click()
  76. Text1.SetFocus
  77. End Sub
  78. Private Sub Command1_Click()
  79. If Label1.Caption = "" Then Exit Sub
  80. List1.AddItem Text1.Text
  81. List2.AddItem Label1.Caption
  82. Text1.Text = ""
  83. Label1.Caption = ""
  84. Check1.Value = 0
  85. Text1.SetFocus
  86. End Sub
  87. Private Sub Command2_Click()
  88. Open "c:\windows\desktop\codes.txt" For Output As #1
  89. For x = 0 To List1.ListCount - 1
  90.     Print #1, List1.List(x) & ":     " & List2.List(x)
  91. Close
  92. End Sub
  93. Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
  94. If Check1.Value = 1 Then
  95.     Label1.Caption = KeyCode
  96.     Command1.SetFocus
  97. End If
  98. End Sub
  99. Private Sub Text1_KeyPress(KeyAscii As Integer)
  100. If Check1.Value = 1 Then KeyAscii = 0
  101. End Sub
  102.