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

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

TextBox.PasswordChar プロパティ

単一TextBox コントロールパスワード文字マスクするために使用される文字取得または設定します

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

<LocalizableAttribute(True)> _
Public Property PasswordChar As
 Char
Dim instance As TextBox
Dim value As Char

value = instance.PasswordChar

instance.PasswordChar = value
[LocalizableAttribute(true)] 
public char PasswordChar { get;
 set; }
[LocalizableAttribute(true)] 
public:
property wchar_t PasswordChar {
    wchar_t get ();
    void set (wchar_t value);
}
/** @property */
public char get_PasswordChar ()

/** @property */
public void set_PasswordChar (char
 value)
public function get PasswordChar
 () : char

public function set PasswordChar
 (value : char)

プロパティ
単一TextBox コントロール入力され文字マスクするために使用される文字入力され文字コントロールマスクない場合は、このプロパティの値を 0 (文字値) に設定します既定値も 0 (文字値) です。

解説解説

UseSystemPasswordChar プロパティは、PasswordChar プロパティよりも優先されます。UseSystemPasswordChartrue設定されている場合既定システムパスワード文字使用されPasswordChar設定され文字無視されます。

Multiline プロパティtrue設定されている場合は、PasswordChar プロパティ設定して外観変更はありません。PasswordChar プロパティtrue設定されている場合は、Multiline プロパティtruefalse のどちらに設定されている場合でも、コントロールキーボード使用した切り取りコピー、および貼り付け実行できません。

メモメモ

日本語版のオペレーティング システムでは、Multiline プロパティtruefalse かに関係なく、PasswordChar適用されます。その他のオペレーティング システムでは、Multilinefalse場合にだけ PasswordChar適用されます。

メモ重要 :

PasswordCharUseSystemPasswordChar、または ReadOnlytrue であるために、TextBoxパスワード モード場合は、TextBox制限モードです。このモードでは、ImeMode が無効になりますが、現在の ImeModeキャッシュされるため、TextBox制限解除され場合に、これを元に戻すことができます。たとえば、ReadOnly切り替えた場合などです。コントロール制限モード場合は、ImeModeシャドウされますデザイナから見た場合表示されImeMode 値が実際の値です。

使用例使用例

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


このページでは「.NET Framework クラス ライブラリ リファレンス」からTextBox.PasswordChar プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からTextBox.PasswordChar プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からTextBox.PasswordChar プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「TextBox.PasswordChar プロパティ」の関連用語

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

   

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



TextBox.PasswordChar プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS