Gets or sets the border type of the text box control.
[Visual Basic] Public Property BorderStyle As BorderStyle [C#] public BorderStyle BorderStyle {get; set;} [C++] public: __property BorderStyle get_BorderStyle(); public: __property void set_BorderStyle(BorderStyle); [JScript] public function get BorderStyle() : BorderStyle; public function set BorderStyle(BorderStyle);
A BorderStyle that represents the border type of the text box control. The default is Fixed3D.
You can use the BorderStyle property to create borderless and flat style controls in addition to the default three dimensional control.
The following example uses TextBox, a derived class, to create a text box that can properly display text using 20 point Arial with a single border. This example uses the PreferredHeight property to determine the appropriate height of the control after the font and BorderStyle have been assigned to the control.
[Visual Basic]
Public Sub CreateTextBox() ' Create an instance of the TextBox control. Dim Text1 as TextBox Set Text1 = New TextBox ' Set the TextBox Font property to Arial 20. Set Text1.Font = New Font ("Arial" , 20) ' Set the BorderStyle property to FixedSingle. Text1.BorderStyle = BorderStyle.FixedSingle ' Make the height of the control equal to the preferred height. Text1.Height = Text1.PreferredHeight End Sub
TextBoxBase Class | TextBoxBase Members | System.WinForms Namespace