devxlogo

August 5, 2000

GetCapsLockKey – Get the state of the CapsLock key

Private Declare Function GetKeyState Lib “user32” (ByVal nVirtKey As Long) As _ Long’ Get the current state of the CapsLock keyFunction GetCapsLockKey() As Boolean GetCapsLockKey = GetKeyState(vbKeyCapital)End Function

GetNumLockKey – Get the state of the NumLock key

Private Declare Function GetKeyState Lib “user32” (ByVal nVirtKey As Long) As _ Long’ Get the current state of the NumLock keyFunction GetNumLockKey() As Boolean GetNumLockKey = GetKeyState(vbKeyNumlock)End Function

PressVirtKey – Press and/or release any key

Private Declare Sub keybd_event Lib “user32” (ByVal bVk As Byte, _ ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)Private Declare Function GetKeyState Lib “user32” (ByVal nVirtKey

SetNumLockKey – Set the state of the Num Lock key

Private Declare Sub keybd_event Lib “user32” (ByVal bVk As Byte, _ ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)Private Declare Function GetKeyState Lib “user32” (ByVal nVirtKey

SetCapsLockKey – Set the state of the Caps Lock key

Private Declare Sub keybd_event Lib “user32” (ByVal bVk As Byte, _ ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)Private Declare Function GetKeyState Lib “user32” (ByVal nVirtKey

GetScrollLockKey – Get the state of the Scroll Lock key

Private Declare Function GetKeyState Lib “user32” (ByVal nVirtKey As Long) As _ Long’ Get the current state of the ScrollLock keyFunction GetScrollLockKey() As Boolean GetScrollLockKey = GetKeyState(vbKeyScrollLock)End Function

Auto Select Content Component

We almost always need to develop forms in which the contents to the control have to be selected whenever the user tabs to a textbox or a combobox. For this