NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

TextBox.CharacterCasing

Gets or sets whether the TextBox control modifies the case of characters as they are typed.

[Visual Basic]
Public Property CharacterCasing As CharacterCasing
[C#]
public CharacterCasing CharacterCasing {get; set;}
[C++]
public: __property CharacterCasing get_CharacterCasing();
public: __property void set_CharacterCasing(CharacterCasing);
[JScript]
public function get CharacterCasing() : CharacterCasing;
public function set CharacterCasing(CharacterCasing);

Property Value

A CharacterCasing value that specifies whether the TextBox control modifies the case of characters. The default is CharacterCasing.Normal.

Remarks

You can use the CharacterCasing property to change the case of characters as required by your application. For example, you could change the case of all characters entered in a TextBox control used for password entry to uppercase or lowercase to enforce a policy for passwords.

Example [Visual Basic]

The following example creates a TextBox control that is used to accept a password. This example uses the CharacterCasing property to change all characters typed to uppercase and the MaxLength property to restrict the password length to eight characters. This example also uses the TextAlign property to center the password in the TextBox control.

[Visual Basic]

Public Sub CreatePasswordTextBox()
   ' Create an instance of the TextBox control.
   Dim Text1 as TextBox
   Set Text1 = New TextBox
   'Text1.MaxLength = 8
   ' Assign the asterisk to be the password character.
   Text1.PasswordChar = "*"
   ' Change all text entered to be lowercase.
   Text1.CharacterCasing = CharacterCasing.Upper
   ' Align the text in the center of the TextBox control.
   Text1.TextAlign = HorizontalAlignment.Center
End Sub

See Also

TextBox Class | TextBox Members | System.WinForms Namespace | CharacterCasing