Guys, I want my textbox are ALL CAPITAL letters even I encode a small letter and it will become Capital .. thanks guys!

Here's your code:

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        TextBox1.Text = TextBox1.Text.ToUpper()
    End Sub
Comments
Correct!

Hi,

Here are other ways of doing it with Keychar or CharacterCasing:

  Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    TextBox2.CharacterCasing = CharacterCasing.Upper 'already by formload can you set te Char in a Textbox toUpper
End Sub

Private Sub TextBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If Char.IsLower(e.KeyChar) Then

            e.Handled = True

            SendKeys.Send(Char.ToUpper(e.KeyChar))

        End If
    End Sub

Hope it helps,

Comments
Correct!

Thanks Eternel
Thanks Luc

both of your codes are right thanks again :)

Edited 3 Years Ago by nashy13

Hi nashy,

Glad to help.
You could mark your thread as "Solved" with the link below the last post.

This question has already been answered. Start a new discussion instead.