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

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

TextBox.TextAlign プロパティ

TextBox コントロールテキストどのように配置するかを取得または設定します

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

<LocalizableAttribute(True)> _
Public Property TextAlign As
 HorizontalAlignment
Dim instance As TextBox
Dim value As HorizontalAlignment

value = instance.TextAlign

instance.TextAlign = value
[LocalizableAttribute(true)] 
public HorizontalAlignment TextAlign { get;
 set; }
[LocalizableAttribute(true)] 
public:
property HorizontalAlignment TextAlign {
    HorizontalAlignment get ();
    void set (HorizontalAlignment value);
}
/** @property */
public HorizontalAlignment get_TextAlign ()

/** @property */
public void set_TextAlign (HorizontalAlignment
 value)
public function get TextAlign
 () : HorizontalAlignment

public function set TextAlign
 (value : HorizontalAlignment)

プロパティ
コントロールテキストどのように配置するかを指定する HorizontalAlignment 列挙値の 1 つ既定値HorizontalAlignment.Left です。

例外例外
例外種類条件

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;
 }
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS