Is there away to determine the Scroll Lock state?

Thanks,
Brandon

Re: Scroll Lock by Derrick

Derrick
Wed Feb 11 15:01:01 CST 2004

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


"Brandon Owensby" <123@abc.com> wrote in message
news:e5$EDZN8DHA.3420@TK2MSFTNGP11.phx.gbl...
> Is there away to determine the Scroll Lock state?
>
> Thanks,
> Brandon
>
>



Re: Scroll Lock by Brandon

Brandon
Wed Feb 11 15:36:22 CST 2004

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