Rendere maiuscoli i caratteri inseriti in una TextBox

Questa Funzione Rende maiuscoli tutti i caratteri inseriti in una textbox o in una ComboBox etc.

Function Upper(KeyAscii As Integer)
If KeyAscii > 96 And KeyAscii < 123 Then
    KeyAscii = KeyAscii - 32
End If
Upper = KeyAscii
End Function

Prova della Funzione:

Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = Upper(KeyAscii)
End Sub

Testato su: Tutti i sistemi operativi