hi friends,
this is senny, here i have to solve my pbm thrugh ur kind suggestion.In my project ,i have to restrict the user to use "CAPS KEY" like when we go to login if caps pressed the msbbox is come with msg "caps key pressed".
thanks in advance
senny
8 5091
hi friends,
this is senny, here i have to solve my pbm thrugh ur kind suggestion.In my project ,i have to restrict the user to use "CAPS KEY" like when we go to login if caps pressed the msbbox is come with msg "caps key pressed".
thanks in advance
senny
Hi ,
If the CAPS LOCK is on and one trys to enter data then we can trap the Ascii code of the keys pressed and then display an message that CAPS letters are not allowed.
thanks
ansuman
Hi ,
If the CAPS LOCK is on and one trys to enter data then we can trap the Ascii code of the keys pressed and then display an message that CAPS letters are not allowed.
thanks
ansuman
As put up by ansuman try trapping the ascii code of keys
A carries an ascii code of 65 it continues till Z which has the ascii code of 90
Put an condition in keypress event
If KeyAscii >= 65 And KeyAscii <= 90 Then
Text1.Locked = True
Msgbox "CAPS ON"
Else
Text1.Locked = False
End If
hi friends,
this is senny, here i have to solve my pbm thrugh ur kind suggestion.In my project ,i have to restrict the user to use "CAPS KEY" like when we go to login if caps pressed the msbbox is come with msg "caps key pressed".
Have a look at this link... How To Toggle the NUM LOCK, CAPS LOCK, and SCROLL LOCK Keys. Specifically, I think you'll be interested in the GetKeyboardState function.
As put up by ansuman try trapping the ascii code of keys
A carries an ascii code of 65 it continues till Z which has the ascii code of 90
Put an condition in keypress event
If KeyAscii >= 65 And KeyAscii <= 90 Then
Text1.Locked = True
Msgbox "CAPS ON"
Else
Text1.Locked = False
End If
THIS DOESN'T WORK IF USER IS TYPING BYPRESSING SHIFT KEY
THIS DOESN'T WORK IF USER IS TYPING BYPRESSING SHIFT KEY
This WORKS even if user is typing by pressing shift key
Here the key Caps or Shift(in my code) is immaterial. All the code does is traps the ascii value in the IFfunction . So irrespective of of SHIFT or CAPS it will work.
I have verified it.
hi friends,
this is senny, here i have to solve my pbm thrugh ur kind suggestion.In my project ,i have to restrict the user to use "CAPS KEY" like when we go to login if caps pressed the msbbox is come with msg "caps key pressed".
thanks in advance
senny
Senny, Killer is absolutely correct: For VBA and VB6, you need to use the GetKeyboardState api. (thanks, Killer, for the link! I added it to Favorites)
However, it is much easier in VB.NET, you just use the Control class: - If Control.IsKeyLocked(Keys.CapsLock) Then _
-
MsgBox("CAPS LOCK is ON!", MsgBoxStyle.Exclamation)
See, VB.DotNet really is nicer! ;) --Sam
This WORKS even if user is typing by pressing shift key
Here the key Caps or Shift(in my code) is immaterial. All the code does is traps the ascii value in the IFfunction . So irrespective of of SHIFT or CAPS it will work.
I have verified it.
I think the basic problem here is that it won't tell you if the capslock key is down. All it will tell you is that an uppercase key was typed - however that happened.
The original poster was not looking for how to tell if an uppercase letter is typed. They wanted to be able to warn that the capslock is down - you know, the way Windows XP does at password entry.
I think the basic problem here is that it won't tell you if the capslock key is down. All it will tell you is that an uppercase key was type - however that happened.
The original poster was not looking for how to tell if an uppercase letter is typed. They wanted to be able to warn that the capslock is down - you know, the way Windows XP does at password entry.
I understood now. Went through your link. Wonderful article
Thanks killer
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Robert |
last post by:
Hi!
I was wondering if the was any way to determine the state of the caps
lock key, on or off.
Of course I can capture the key events and see whether the caps lock is
pressed, but that does not...
|
by: Peter D |
last post by:
I have a second hand bar code reader (keyboard wedge) en i can read
the bar codes but after every scan he turns my caps lock on.
(GRRRRRR).
I search a code to turn my caps lock off or can anyone...
|
by: Malcolm |
last post by:
Use all lower case for ansi c functions, and Capitalise For
Platform-Specific.
If you call something with caps, then your function name requires caps
itself.
|
by: Mike L |
last post by:
How do I turn Caps Lock on, when my form opens?
|
by: John A Grandy |
last post by:
does anyone know of an intrinsic .NET function , or font , or other
mechanism , to do "proper-case all-caps" ... ?
so, for a name like "Arnold Schwarzenegger" ...
.... I want it entirely in...
|
by: charlies224 |
last post by:
Hi,
I am writting a software that requires me to make sure the Num Lock is
always on and Caps Lock is always off.
First, I know how to detect if Num Lock or Caps Lock is on or off (if...
|
by: Fred's |
last post by:
Hi Folks,
I've been trying to figure out how can I see the text in caps in my
report, but til now, nothing works.
Does anyone knows how can I makes the text in caps in my report?
Your...
|
by: trondhuso |
last post by:
Hi,
I have a solution that - at time of writing - has to use tables to
render a list of database-results. My challenge though is that we have
used iframes and such to render the different lists...
|
by: DanicaDear |
last post by:
I want to use all caps in a database. I desire to show all caps AS YOU TYPE regardless of how the keyboard/caps lock is set. I tried to format my form field with an on-click event…and this is the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |