DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links