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

Dim instance As TextBoxBase Dim value As BorderStyle value = instance.BorderStyle instance.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 です。


BorderStyle プロパティを使用すると、既定の 3D コントロールだけでなく、境界線のないコントロールやフラットなスタイルのコントロールを作成できます。
![]() |
---|
派生クラス RichTextBox は、BorderStyle.FixedSingle スタイルをサポートしていません。このスタイルを設定すると、BorderStyle に BorderStyle.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

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


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

- TextBoxBase.BorderStyle プロパティのページへのリンク