textbox reversing text

B

barry

I am using the following code in a textbox:

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged

Dim txt As TextBox = CType(sender, TextBox)

txt.Text = txt.Text.ToUpper

End Sub

If I type in the word "the" it upper cases it but reverses "the" to "eht"

It is the ToUpper that causes this but how to correct it?



thanks

barry
 
H

Herfried K. Wagner [MVP]

barry said:
I am using the following code in a textbox:

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged

Dim txt As TextBox = CType(sender, TextBox)

txt.Text = txt.Text.ToUpper

End Sub

If I type in the word "the" it upper cases it but reverses "the" to "eht"

It is the ToUpper that causes this but how to correct it?

Set the textbox's 'CharacterCasing' property to 'Upper'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top