Up Case under Keypress?

walter21

Newcomer
Joined
Jan 10, 2003
Messages
5
How can I do something like this, in VB.NET?


Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub


Thanks
 
Visual Basic:
    Private Sub Text1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Text1.TextChanged
        Text1.Text = Text1.Text.ToUpper
        Text1.SelectionStart = Text1.Text.Length
    End Sub
 
Thanks Robby.

I think that is a good idea, but the problem is that the cursor is always at last position (Maybe I should use 'SelectionStart'), Also I can see some effect during asignation of upcase string when I try to type fast.
 
What do you mean "Maybe I should use 'SelectionStart' " ?
Is that not what I posted?

As for typing fast, I've held down a key which is probably 10 chars/second and they're all upper case.
 
I used this, and it's work well

Private Sub Text1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Text1.TextChanged
Dim As Integer = Text1.SelectionStart
Text1.Text = Text1.Text.ToUpper
If >= 0 Then
Text1.SelectionStart =
End If
End Sub

Thank you for your help Robby :)


P.D. I'm sorry, but my English is not very good
 
Back
Top