Compartir vía


CharacterCasing Enumeración

Definición

Especifica el caso de caracteres en un control TextBox.

public enum class CharacterCasing
public enum CharacterCasing
type CharacterCasing = 
Public Enum CharacterCasing
Herencia
CharacterCasing

Campos

Nombre Valor Description
Normal 0

El caso de los caracteres se deja sin cambios.

Upper 1

Convierte todos los caracteres en mayúsculas.

Lower 2

Convierte todos los caracteres en minúsculas.

Ejemplos

En el ejemplo siguiente se crea un TextBox control que se usa para aceptar una contraseña. En este ejemplo se usa la CharacterCasing propiedad para cambiar todos los caracteres escrito en mayúsculas y la MaxLength propiedad para restringir la longitud de la contraseña a ocho caracteres. En este ejemplo también se usa la TextAlign propiedad para centrar la contraseña en el TextBox control .

public:
   void CreateMyPasswordTextBox()
   {
      // Create an instance of the TextBox control.
      TextBox^ textBox1 = gcnew TextBox;
      // Set the maximum length of text in the control to eight.
      textBox1->MaxLength = 8;
      // Assign the asterisk to be the password character.
      textBox1->PasswordChar = '*';
      // Change all text entered to be lowercase.
      textBox1->CharacterCasing = CharacterCasing::Lower;
      // Align the text in the center of the TextBox control.
      textBox1->TextAlign = HorizontalAlignment::Center;
   }
public void CreateMyPasswordTextBox()
 {
    // Create an instance of the TextBox control.
    TextBox textBox1 = new TextBox();
    // Set the maximum length of text in the control to eight.
    textBox1.MaxLength = 8;
    // Assign the asterisk to be the password character.
    textBox1.PasswordChar = '*';
    // Change all text entered to be lowercase.
    textBox1.CharacterCasing = CharacterCasing.Lower;
    // Align the text in the center of the TextBox control.
    textBox1.TextAlign = HorizontalAlignment.Center;
 }
Public Sub CreateMyPasswordTextBox()
    ' Create an instance of the TextBox control.
    Dim textBox1 As New TextBox()
    ' Set the maximum length of text in the control to eight.
    textBox1.MaxLength = 8
    ' Assign the asterisk to be the password character.
    textBox1.PasswordChar = "*"c
    ' Change all text entered to be lowercase.
    textBox1.CharacterCasing = CharacterCasing.Lower
    ' Align the text in the center of the TextBox control.
    textBox1.TextAlign = HorizontalAlignment.Center
End Sub

Comentarios

Use los miembros de esta enumeración para establecer el valor de la CharacterCasing propiedad del TextBox control.

Se aplica a