What should I do to enable Cabs Lock On for my whole program so that all the characters typed in any textbox appear in UpperCase?
Printable View
What should I do to enable Cabs Lock On for my whole program so that all the characters typed in any textbox appear in UpperCase?
You can use this code to have any text typed into a textbox in uppercase, without using the CAPS key.
SunnyCode:Private Sub Text1_Change()
Text1 = UCase(Text1)
Text1.SelStart = Len(Text1.Text)
End Sub
[/code]Code:' Remarks:
'the code will have to go in every textbox keypress event
'either of these will work..use the one you choose
' Allow only alpha data in a text box
'
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii >= 65 And KeyAscii <= 90 Or KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub
' OR
'This should also uppercase other letters like åäöüê...
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = KeyAscii and -33
End Sub
' OR
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub
[Edited by HeSaidJoe on 11-18-2000 at 09:10 AM]