Results 1 to 2 of 2

Thread: How to find if Caps Lock turned on (Win Forms)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2004
    Posts
    16

    How to find if Caps Lock turned on (Win Forms)

    I have a login form which has two textboxes. Now when the username textbox gets focus i want to find out if the caps lock key is turned. Right now I am using the following code to see if it is turned on, but it doesnt work:

    Code:
    If (Control.ModifierKeys And Keys.CapsLock) = Keys.CapsLock Then
                ttLogin.SetToolTip(Me.txtUsername, "Your Caps Lock key is turned On")
            End If
    All your distributed computing needs are belong to us!

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Probably by using the GetKeyState API.

    Or take a look here

    http://weblogs.asp.net/robgruen/archive/2004/04/15.aspx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width