Aracılığıyla paylaş


TextBoxBase.BorderStyle Özellik

Tanım

Metin kutusu denetiminin kenarlık türünü alır veya ayarlar.

public:
 property System::Windows::Forms::BorderStyle BorderStyle { System::Windows::Forms::BorderStyle get(); void set(System::Windows::Forms::BorderStyle value); };
public System.Windows.Forms.BorderStyle BorderStyle { get; set; }
member this.BorderStyle : System.Windows.Forms.BorderStyle with get, set
Public Property BorderStyle As BorderStyle

Özellik Değeri

BorderStyle Metin kutusu denetiminin kenarlık türünü temsil eden bir. Varsayılan değer: Fixed3D.

Özel durumlar

Sabit listesi için geçerli değerler aralığında olmayan bir değer özelliğine atandı.

Örnekler

Aşağıdaki kod örneği, tek bir kenarlıkla 20 punto Arial kullanarak metni düzgün bir şekilde görüntüleyebilen bir metin kutusu oluşturmak için türetilmiş sınıfını kullanır TextBox. Bu örnekte, yazı tipinden sonra denetimin PreferredHeight uygun yüksekliğini belirlemek ve BorderStyle denetime atanmış olması için özelliği kullanılır.

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.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 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

Açıklamalar

varsayılan üç boyutlu denetime ek olarak kenarlıksız ve düz stil denetimleri oluşturmak için özelliğini kullanabilirsiniz BorderStyle .

Uyarı

Türetilmiş sınıfı, RichTextBoxstili desteklemez BorderStyle.FixedSingle . Bu stil, bunun BorderStyle yerine stilinin kullanılmasına BorderStyle.Fixed3D neden olur.

Şunlara uygulanır