Determining state of CAPS LOCK and NUM LOCK


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Determining state of CAPS LOCK and NUM LOCK

  1. #1
    David Williams Guest

    Determining state of CAPS LOCK and NUM LOCK


    All of the (client) forms that I have created over the last few years include
    a status bar with the CAPS LOCK and NUM LOCK states shown on them. With
    VB.NET, however, I can not find a way to query the state of these to set
    them. Any clues?

  2. #2
    Patrick Steele [MVP] Guest

    Re: Determining state of CAPS LOCK and NUM LOCK

    In article <3cac4aab$1@10.1.10.29> (from David Williams
    <dwilliams@strohlsystems.com>),
    >
    > All of the (client) forms that I have created over the last few years include
    > a status bar with the CAPS LOCK and NUM LOCK states shown on them. With
    > VB.NET, however, I can not find a way to query the state of these to set
    > them. Any clues?


    There's nothing in the framework for that:

    http://discuss.develop.com/archives/...DOTNET&P=83058

    You'd have to PInvoke GetKeyState:

    <DllImport("user32.dll")> _
    Public Shared Function GetKeyState(VirtKey As Integer) As Integer
    End Sub

    --
    Patrick Steele
    Microsoft .NET MVP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center