CharacterCasing Enumeráció
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
A vezérlőelemben lévő TextBox karakterek kis- és nagybetűit adja meg.
public enum class CharacterCasing
public enum CharacterCasing
type CharacterCasing =
Public Enum CharacterCasing
- Öröklődés
Mezők
| Név | Érték | Description |
|---|---|---|
| Normal | 0 | A karakterek esete változatlan marad. |
| Upper | 1 | Az összes karaktert nagybetűssé alakítja. |
| Lower | 2 | Az összes karaktert kisbetűssé alakítja. |
Példák
Az alábbi példa létrehoz egy vezérlőt TextBox , amely a jelszó elfogadására szolgál. Ez a példa a CharacterCasing tulajdonság használatával az összes beírt karaktert nagybetűsre, a MaxLength tulajdonságot pedig nyolc karakterre korlátozza. Ez a példa a TextAlign tulajdonság használatával is középre helyezi a jelszót a TextBox vezérlőben.
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
Megjegyzések
A számbavétel tagjaival állítsa be a CharacterCasing vezérlőelem tulajdonságának TextBox értékét.