Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adobe Customization Wizard XI issues 26 210
What is the compatible hibernate version for spring 4.3.1 10 77
Path of Workbook 3 60
Export Table to CSV - Access to CSV - using python 18 100
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

920 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

12 Experts available now in Live!

Get 1:1 Help Now