home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Programmer'…arterly (Limited Edition) / Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso / code / ch18code / keyboard.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-08-13  |  1.6 KB  |  61 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   1680
  5.    ClientLeft      =   3588
  6.    ClientTop       =   4044
  7.    ClientWidth     =   5964
  8.    Height          =   2004
  9.    Left            =   3540
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1680
  12.    ScaleWidth      =   5964
  13.    Top             =   3768
  14.    Width           =   6060
  15.    Begin VB.CommandButton Command1 
  16.       Caption         =   "Change"
  17.       Height          =   492
  18.       Left            =   120
  19.       TabIndex        =   2
  20.       Top             =   720
  21.       Width           =   1092
  22.    End
  23.    Begin VB.Timer Timer1 
  24.       Interval        =   60
  25.       Left            =   1320
  26.       Top             =   840
  27.    End
  28.    Begin VB.Label Label2 
  29.       Height          =   252
  30.       Left            =   1680
  31.       TabIndex        =   1
  32.       Top             =   120
  33.       Width           =   852
  34.    End
  35.    Begin VB.Label Label1 
  36.       Caption         =   "NumLock is: "
  37.       Height          =   252
  38.       Left            =   120
  39.       TabIndex        =   0
  40.       Top             =   120
  41.       Width           =   1452
  42.    End
  43. Attribute VB_Name = "Form1"
  44. Attribute VB_Creatable = False
  45. Attribute VB_Exposed = False
  46. Private Keyboard As Keyboard
  47. Private Sub Command1_Click()
  48.     Keyboard.NumLock = Not Keyboard.NumLock
  49. End Sub
  50. Private Sub Form_Load()
  51.     ' Create a Keyboard object on start-up.
  52.     Set Keyboard = New Keyboard
  53. End Sub
  54. Private Sub Timer1_Timer()
  55.     If Keyboard.NumLock Then
  56.         Label2.Caption = "On"
  57.     Else
  58.         Label2.Caption = "Off"
  59.     End If
  60. End Sub
  61.