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:

  1. Normal: If it is set normal, then we can enter both small or capital letter using shift and CapsLock property.
  2. Upper: If it is set upper, and then we can enter in uppercase only.
  3. Lower: If it is set lower, then we can enter in lowercase only.

By default this property is set to "normal".

Example:

TextBox.CharacterCasing Property 1

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.

TextBox.CharacterCasing Property 2

Change the property using code:

private void Form1_Load(object sender, EventArgs e)
{
    textInput.CharacterCasing = CharacterCasing.Upper;
}


Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.