CodeItBetter Programming Another VB Programming Blog

How to make a TextBox automatically capitalize input

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
'Controls - How to make a TextBox automatically capitalize input
'Make the TextBox's Change event handler capitalize the text. Save and restore
'the SelStart property so resetting the value does not move the insertion
'position.

Private Sub Text1_Change()
    Dim intPos As Integer
 
    intPos = Text1.SelStart
    Text1.Text = UCase$(Text1.Text)
    Text1.SelStart = intPos
End Sub
Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.