Home »
.Net »
C#.Net »
C#.Net Windows Development
TextBox.CharacterCasing Property with Example in C#.Net
C#.Net - TextBox.CharacterCasing Property with Example: Here we are going to learn about the CharacterCasing property of TextBox Control in C#.Net Windows Application Development.
Submitted by IncludeHelp, on September 03, 2018
TextBox is an input control, using TextBox we can input values for our windows application. Here we are demonstrating use of CharacterCasing property.
CharacterCasing property has three options:
- Normal: If it is set normal, then we can enter both small or capital letter using shift and CapsLock property.
- Upper: If it is set upper, and then we can enter in uppercase only.
- Lower: If it is set lower, then we can enter in lowercase only.
By default this property is set to "normal".
Example:
In this example, we took a Windows form that contains a TextBox named txtInput, we can change the name of control using name property. And we set CharacterCasing property to "Upper" using property window, we can open property window using "F4" short-cut key for selected control.
Change the property using code:
private void Form1_Load(object sender, EventArgs e)
{
textInput.CharacterCasing = CharacterCasing.Upper;
}