Solved

how to get Caps and Num Lock information on statusbar in vb.net

Posted on 2004-04-12
5
597 Views
Last Modified: 2011-10-03
i am using statusbar control in vb.net
and i have made two panels on that and i want that whenever i run this application and at that time if users do caps on/ off or num lock on/off then it appears in my status bar
how can i do it.
0
Comment
Question by:deepakyadav
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
mahanatti earned 125 total points
ID: 10810814
Try this for Caps Lock...

within your class declare the method GetKeyState and two constans as velow

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

  Const VK_NUMLOCK = 144
  Const VK_CAPLOCK = 20

Where required use this code to call the function

Dim capslocki = GetKeyState(&H14)
   If capslocki Then
      MsgBox("CapsLock On")
   End If

-Maha.
0
 
LVL 2

Expert Comment

by:mahanatti
ID: 10810855
To get the NumLock info

Dim numlocki = GetKeyState(&H90)
    If numlocki Then
      MsgBox("NumLock On")
    End If

-Maha.
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Progress

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question