In this post we will see how to convert textbox text to upper case when it is entered .

For this we will consider an example, suppose a textbox is taken for full name, then we should allow only characters/letters in it. And we want full name to be entered in upper case. For this we can validate a textbox such that the text entered in it should appear in uppercase automatically even if user entered a lowercase.

C#.Net winforms textbox Uppercase

I am taking a textbox txtFullName on Form and a errorprovider. Now we are taking a keypress event of textbox txtFullName . The c# code is like this..

According to the above code, textbox allows only letters, backspace and space. And it converts the input text to uppercase even if user enters a lowercase letter .

If any other key like number or special character is entered by the user , the error provider will blink.