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

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

TextBoxBase.BorderStyle プロパティ

テキスト ボックス コントロール境界線種類取得または設定します

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

Public Property BorderStyle As
 BorderStyle
Dim instance As TextBoxBase
Dim value As BorderStyle

value = instance.BorderStyle

instance.BorderStyle = value
public BorderStyle BorderStyle { get; set;
 }
public:
property BorderStyle BorderStyle {
    BorderStyle get ();
    void set (BorderStyle value);
}
/** @property */
public BorderStyle get_BorderStyle ()

/** @property */
public void set_BorderStyle (BorderStyle value)
public function get BorderStyle
 () : BorderStyle

public function set BorderStyle
 (value : BorderStyle)

プロパティ
テキスト コントロール境界線種類を表す BorderStyle。既定値Fixed3D です。

例外例外
例外種類条件

InvalidEnumArgumentException

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

解説解説

BorderStyle プロパティ使用すると、既定3D コントロールだけでなく、境界線のないコントロールフラットなスタイルコントロール作成できます

メモメモ

派生クラス RichTextBox は、BorderStyle.FixedSingle スタイルサポートしていません。このスタイル設定すると、BorderStyleBorderStyle.Fixed3D スタイル代用されます。

使用例使用例

派生クラス TextBox使用して20 ポイントArialテキスト適切に表示する一重線の境界線を持つテキスト ボックス作成するコード例次に示します。この例では、PreferredHeight プロパティ使用してフォントBorderStyleコントロール割り当てられた後のコントロール適切な高さが判断されます。

Public Sub CreateTextBox()
    ' Create an instance of the TextBox control.
    Dim textBox1 As New
 TextBox()
    
    ' Set the TextBox Font property to Arial 20.
    textBox1.Font = New Font("Arial",
 20)
    ' Set the BorderStyle property to FixedSingle.
    textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
    ' Make the height of the control equal to the preferred height.
    textBox1.Height = textBox1.PreferredHeight
End Sub

public void CreateTextBox()
 {
    // Create an instance of the TextBox control.
    TextBox textBox1 = new TextBox();
 
    // Set the TextBox Font property to Arial 20.
    textBox1.Font = new Font ("Arial" , 20);
    // Set the BorderStyle property to FixedSingle.
    textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
    // Make the height of the control equal to the preferred height.
    textBox1.Height = textBox1.PreferredHeight;
 }

public:
   void CreateTextBox()
   {
      // Create an instance of the TextBox control.
      TextBox^ textBox1 = gcnew TextBox;
      
      // Set the TextBox Font property to Arial 20.
      textBox1->Font = gcnew System::Drawing::Font( "Arial", 20 );
      // Set the BorderStyle property to FixedSingle.
      textBox1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
      // Make the height of the control equal to the preferred height.
      textBox1->Height = textBox1->PreferredHeight;
   }
public void CreateTextBox()
{
    // Create an instance of the TextBox control.
    TextBox textBox1 = new TextBox();
    // Set the TextBox Font property to Arial 20.
    textBox1.set_Font(new Font("Arial", 20));
    // Set the BorderStyle property to FixedSingle.
    textBox1.set_BorderStyle(System.Windows.Forms.BorderStyle.FixedSingle);
    // Make the height of the control equal to the preferred height.
    textBox1.set_Height(textBox1.get_PreferredHeight());
} //CreateTextBox
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「TextBoxBase.BorderStyle プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS