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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uppercase character

Status
Not open for further replies.

Panucci

Programmer
Jan 11, 2001
3
0
0
BR
How can I set the textbox to Uppercase character when I'm digiting?
 
Try something like this:
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
    Select Case KeyAscii
        Case 32 To 126  'printable characters
            Text1.Text = Text1.Text & UCase(Chr(KeyAscii))
            KeyAscii = 0
            SendKeys "{END}"
    End Select
End Sub
 
I just noticed that if you use shift-numeric keys, the text starts highlighting. Somewhat annoying.
Code:
Replace:
    SendKeys "{END}"
With:
    Text1.SelStart = Len(Text1.Text)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top