Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force Capital Lock 1

Status
Not open for further replies.

sisan

Programmer
Jan 9, 2002
39
ID
Hi..
Got a problem here...

I need to force the CapsLock on my keyboard on. How can we do it in VB command ? I have try it with SendKeys "{CAPSLOCK}", but it didn't work. Any suggestion ?

Thank you
 
You can use the "keybd_event " API for that.
Greetings,
Rick
 
Use the KeyPress event to force all letters to be capitalized.

Private Sub Text1_KeyPress(KeyAscii As Integer)
'// Capitalize the entered small letters.
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub
Thanks and Good Luck!

zemp
 
If you just want to force all input to capitals you can also use Ucase() function
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Thank you guys,

but my form has a lot of textboxes, so I want as the form shown, the keyboard caps lock always on &quot;On&quot; position. For any reason, I use regular textboxes, not a MaskedEdit textbox which has an UpperCase property.
 
Yes, if it's only because of capitals in your textboxes SemperFiDownUnda's solution will be the best for you.....
Greetings,
Rick
 
Thank's SemperFiDownUnda, you've helped me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top