Results 1 to 4 of 4

Thread: "All Caps" in a text box

  1. #1

    Thread Starter
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    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

  2. #2
    Junior Member
    Join Date
    Dec 1999
    Posts
    17

    Post

    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
    [email protected]

  3. #3
    Lively Member
    Join Date
    Oct 1999
    Posts
    101

    Post

    Option 2:
    Code:
    Private Sub Text1_Change()
        Text1 = UCase(Text1)
        Text1.SelStart = Len(Text1)
    End Sub
    All the best.

    Chris

  4. #4

    Thread Starter
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    Thank you both. I used both of your suggestions, just to make sure that it gets capitalized.

    ------------------
    Ryan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width