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 ?
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!
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.'
but my form has a lot of textboxes, so I want as the form shown, the keyboard caps lock always on "On" position. For any reason, I use regular textboxes, not a MaskedEdit textbox which has an UpperCase property.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.