?
Solved

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

Posted on 2004-04-12
5
Medium Priority
?
599 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 500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Simple Linear Regression
Progress

719 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