CharacterCasing 열거형
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
TextBox 컨트롤에 있는 문자의 대/소문자를 지정합니다.
public enum class CharacterCasing
public enum CharacterCasing
type CharacterCasing =
Public Enum CharacterCasing
- 상속
필드
| Name | 값 | Description |
|---|---|---|
| Normal | 0 | 문자의 대/소문자는 변경되지 않은 상태로 유지됩니다. |
| Upper | 1 | 모든 문자를 대문자로 변환합니다. |
| Lower | 2 | 모든 문자를 소문자로 변환합니다. |
예제
다음 예제에서는 암호를 허용하는 데 사용되는 컨트롤을 만듭니다 TextBox . 이 예제에서는 속성을 사용하여 대문자로 입력된 모든 문자를 변경하고 MaxLength 이 속성을 사용하여 CharacterCasing 암호 길이를 8자로 제한합니다. 또한 이 예제에서는 TextAlign 속성을 사용하여 컨트롤의 암호를 가운데에 배치합니다 TextBox .
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
설명
이 열거형의 멤버를 사용하여 컨트롤의 CharacterCasing 속성 TextBox 값을 설정합니다.