Scroll Lock

  • Thread starter Thread starter Brandon Owensby
  • Start date Start date
Hi Brandon,

As far as I know, there is not a way to interrogate the keyboard directly
from .NET. You can, however, use the GetKeyState( ) Windows API. Here is
the declaration:

Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As
Long

A function to give you the state of the scroll lock key:

Private Function IsScrollLockOn( ) As Boolean
Return Convert.ToBoolean(GetKeyState(Keys.Scroll) Mod 2)
End Function

HTH,
Derrick
 
I should have mentioined the fact that I'm using C# .Net. This appears to
be another language like Visual Basic. I am unable to figure out how to
duplicate what you have done in VB in C#. If anyone can help me do the same
in C# I'd be very gratefull. Thanks.

Brandon
 
Back
Top