TextBox.CharacterCasing プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As TextBox Dim value As CharacterCasing value = instance.CharacterCasing instance.CharacterCasing = value
public: property CharacterCasing CharacterCasing { CharacterCasing get (); void set (CharacterCasing value); }
/** @property */ public CharacterCasing get_CharacterCasing () /** @property */ public void set_CharacterCasing (CharacterCasing value)
public function get CharacterCasing () : CharacterCasing public function set CharacterCasing (value : CharacterCasing)
TextBox コントロールで大文字と小文字を変更するかどうかを指定する CharacterCasing 列挙値の 1 つ。既定値は CharacterCasing.Normal です。


CharacterCasing プロパティを使用して、アプリケーションの必要に応じて文字の大文字と小文字を変更できます。たとえば、パスワードの入力に使用される TextBox コントロールに入力されたすべての文字を大文字または小文字に変更して、パスワードのポリシーを適用できます。

パスワードを受け取るために使用される TextBox コントロールを作成するコード例を次に示します。この例では、CharacterCasing プロパティを使用して、入力されたすべての文字を大文字に変更します。また、MaxLength プロパティを使用して、パスワード長を 8 文字に制限します。この例では、TextAlign プロパティも使用して、TextBox コントロールの中央にパスワードを配置します。
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
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: 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.set_MaxLength(8); // Assign the asterisk to be the password character. textBox1.set_PasswordChar('*'); // Change all text entered to be lowercase. textBox1.set_CharacterCasing(CharacterCasing.Lower); // Align the text in the center of the TextBox control. textBox1.set_TextAlign(HorizontalAlignment.Center); } //CreateMyPasswordTextBox
public function CreateMyPasswordTextBox() { // Create an instance of the TextBox control. 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; }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からTextBox.CharacterCasing プロパティを検索する場合は、下記のリンクをクリックしてください。

- TextBox.CharacterCasing プロパティのページへのリンク