Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Select Case e.KeyChar
Case Chr(8) 'Retroceso
Case Else
Dim pos As Integer
pos = TextBox1.SelectionStart
Dim Caracter, Texto As String
Caracter = e.KeyChar
Texto = TextBox1.Text
If pos = Len(Texto) Then
TextBox1.Text = Texto & UCase(Caracter)
Else
TextBox1.Text = Strings.Left(Texto, pos) & UCase(Caracter) & Mid(Texto, pos + 1)
End If
TextBox1.SelectionStart = pos + 1
e.Handled = True
End Select
End Sub