Click to See Complete Forum and Search --> : "All Caps" in a text box
Gimpster
Jan 19th, 2000, 05:34 AM
Is there some easy way of making it so that when a user enters a letter in a text box that the letter always appears as a capital letter? Or will I have to code something into the KeyPress event that will change the text type? Thanks
------------------
Ryan
JoeH
Jan 19th, 2000, 05:41 AM
You can do the following in the KeyPress event :
KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
This will capitalize all the text that is entered in the textbox.
------------------
Joe Handal
Workstation Engineer
joe.handal@carle.com
ChrisJackson
Jan 19th, 2000, 05:50 AM
Option 2:
Private Sub Text1_Change()
Text1 = UCase(Text1)
Text1.SelStart = Len(Text1)
End Sub
All the best.
Chris
Gimpster
Jan 20th, 2000, 05:13 AM
Thank you both. I used both of your suggestions, just to make sure that it gets capitalized.
------------------
Ryan
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.