CharacterCasing Enum

Definitie

Hiermee geeft u het hoofdlettergebruik van tekens in een TextBox besturingselement op.

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

Velden

Name Waarde Description
Normal 0

Het hoofdlettergebruik blijft ongewijzigd.

Upper 1

Converteert alle tekens naar hoofdletters.

Lower 2

Converteert alle tekens naar kleine letters.

Voorbeelden

In het volgende voorbeeld wordt een TextBox besturingselement gemaakt dat wordt gebruikt om een wachtwoord te accepteren. In dit voorbeeld wordt de CharacterCasing eigenschap gebruikt om alle tekens te wijzigen die zijn getypt in hoofdletters en de MaxLength eigenschap om de wachtwoordlengte te beperken tot acht tekens. In dit voorbeeld wordt ook de TextAlign eigenschap gebruikt om het wachtwoord in het TextBox besturingselement te centreren.

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

Opmerkingen

Gebruik de leden van deze opsomming om de waarde van de CharacterCasing eigenschap van het TextBox besturingselement in te stellen.

Van toepassing op