e.KeyChar \ convert text toUpper?

loiter

Newcomer
Joined
Feb 18, 2003
Messages
4
Hello,

I am trying to change the text to upper case as the user types (it is a textbox that holds state abbrev). I read where e.keychar can do this but haven't been able to find examples. Would anyone have any plz?

thanks !
 
One way is to use the Leave or Validating event..
Visual Basic:
    Private Sub TextBox2_Leave(ByVal sender As Object, ByVal e As EventArgs) Handles TextBox2.Leave
        TextBox2.Text = TextBox2.Text.ToUpper
    End Sub
 
Of course, this can also be done by using the .CharacterCasing property of the textbox (if it is the standard tb, that is). <g>
 
Back
Top