Solved

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

Posted on 2004-04-12
5
592 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
  • 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
 

Expert Comment

by:tankman37
ID: 10813876
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
withoutTen challenge 14 88
maxMirror challenge 10 89
Reading variable length EBCDIC in SAS 9 79
wordcount challenge 11 78
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
A short article about a problem I had getting the GPS LocationListener working.
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now