CharacterCasing Výčet

Definice

Určuje velikost písmen v ovládacím TextBox prvku.

public enum class CharacterCasing
public enum CharacterCasing
type CharacterCasing = 
Public Enum CharacterCasing
Dědičnost
CharacterCasing

Pole

Lower 2

Převede všechny znaky na malá písmena.

Normal 0

Malá písmena znaků zůstanou beze změny.

Upper 1

Převede všechny znaky na velká písmena.

Příklady

Následující příklad vytvoří TextBox ovládací prvek, který se používá k přijetí hesla. Tento příklad používá CharacterCasing vlastnost ke změně všech znaků zadaných velkými písmeny a MaxLength vlastnost omezit délku hesla na osm znaků. Tento příklad také používá TextAlign vlastnost k zarovnání hesla do TextBox ovládacího prvku.

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

Poznámky

Pomocí členů tohoto výčtu nastavte hodnotu CharacterCasing vlastnosti TextBox ovládacího prvku.

Platí pro