Results 1 to 3 of 3

Thread: Num Lock.....

  1. #1

    Thread Starter
    Lively Member Adrian Koh's Avatar
    Join Date
    Jan 2001
    Location
    Johor, Malaysia
    Posts
    64

    Question

    Why does num lock goes off automatically when the program run.

    How do you turn in on in vb.

    Thanks
    VisualBasic5.0ServicePack3

  2. #2
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Brooklyn NY USA
    Posts
    1,258
    Put all this in the declaration section
    Code:
    Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
    Private Declare Function SetKeyboardState Lib "user32" (lppbKeyState As Byte) As Long
    Const VK_NUMLOCK = &H90
    Put this in the form_load
    Code:
    Dim cls As Boolean
    Dim keys(0 To 255) As Byte
    GetKeyboardState keys(0)
    cls = keys(VK_NUMLOCK)
    If cls <> True Then
    keys(VK_CAPITAL) = 1
    SetKeyboardState keys(0)
    End If

  3. #3
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width