TextBox.CharacterCasing プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TextBox.CharacterCasing プロパティの意味・解説 

TextBox.CharacterCasing プロパティ

TextBox コントロールで入力された文字の大文字と小文字を変更するかどうかを取得または設定します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Property CharacterCasing As
 CharacterCasing
Dim instance As TextBox
Dim value As CharacterCasing

value = instance.CharacterCasing

instance.CharacterCasing = value
public CharacterCasing CharacterCasing { get;
 set; }
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 です。

例外例外
例外の種類条件

InvalidEnumArgumentException

列挙体の有効値の範囲内にない値が、プロパティに代入されました。

解説解説
使用例使用例

パスワードを受け取るために使用される 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;
 }
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

TextBox.CharacterCasing プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TextBox.CharacterCasing プロパティのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS