)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the border style and appearance in the WinForms TextboxExt?

Platform: WinForms |
Control: TextBoxExt |
Published Date: October 23, 2015 |
Last Revised Date: February 3, 2020

Customize the border style and appearance

You can customize the border appearance of the TextBoxExt by using the following properties.

1. BorderStyle.

2. Border3DStyle.

3. BorderSides.

4. BorderColor.

 

BorderStyle:

This property specifies the border style of the TextBoxExt. The default value of the BorderStyle is BorderStyle.Fixed3D. The border style is categorized as: 

1. None.

2. FixedSingle.

3. Fixed3D.

Border3DStyle:

This property sets the 3D border style for the TextBoxExt, and this can be used when the BorderStyle is specified as Fixed3D. The Border3DStyles are categorized as:

1. RaisedInner.

2. RaisedOuter.

3. SunkenInner.

4. SunkenOuter.

5. Raised.

6. Etched.

7. Bump.

8. Sunken.

9. Adjust.

10. Flat.

BorderSides:

This property specifies the border sides of the control, and this can be used when the BorderStyle is specified as Fixed3D. BorderSides are:

1. All.

2. Top.

3. Bottom.

4. Left.

5. Right.

6. Middle.

BorderColor:

This property sets the single line bordercolor of the TextBoxExt and can be used when the BorderStyle is specified as FixedSingle.

C#

//Sets the border style as None.
this.textBoxExt1.BorderStyle = BorderStyle.None;
//Sets the border style as FixedSingle.
this.textBoxExt1.BorderStyle = BorderStyle.FixedSingle;
//Sets the border style as Fixed3D.
this.textBoxExt1.BorderStyle = BorderStyle.Fixed3D;
//Sets the border raised inner and outer edges.
this.TextBoxExt3.Border3DStyle = Border3DStyle.Raised;
//Sets the border raised outer edge and no inner edge.
this.TextBoxExt3.Border3DStyle = Border3DStyle.RaisedOuter;
//Sets the border raised inner edge and no outer edge.
this.TextBoxExt3.Border3DStyle = Border3DStyle.RaisedInner;
//Sets the edged border appearance of inner edge and outer edge.
this.TextBoxExt3.Border3DStyle = Border3DStyle.Etched;
//Sets the border with no three-dimensional effects.
this.TextBoxExt3.Border3DStyle = Border3DStyle.Flat;
//Sets the border with sunken inner and outer edges.
this.TextBoxExt3.Border3DStyle = Border3DStyle.Sunken;
//Sets the border with sunken inner and no outer edges.
this.TextBoxExt3.Border3DStyle = Border3DStyle.SunkenInner;
//Sets the border with sunken outer and no inner edges.
this.TextBoxExt3.Border3DStyle = Border3DStyle.SunkenOuter;
//Draws the border outside the specified rectangle, preserving the dimension of the rectangle for drawing.
this.TextBoxExt3.Border3DStyle = Border3DStyle.Adjust;
//Shows the border around the TextBoxExt.
this.textBoxExt2.BorderSides = Border3DSide.All;
//Shows the border on top of the TextBoxExt.
this.textBoxExt2.BorderSides = Border3DSide.Top;
//Shows the border at bottom of the TextBoxExt.
this.textBoxExt2.BorderSides = Border3DSide.Bottom;
//Shows the border on left side of the TextBoxExt.
this.textBoxExt2.BorderSides = Border3DSide.Left;
//Shows the border on right side of the TextBoxExt.
this.textBoxExt2.BorderSides = Border3DSide.Right;
//Sets the border color when BorderStyle is set as FixedSingle.
this.textBoxExt1.BorderColor = this.colorPickerButton1.SelectedColor;

VB

'Sets the border style as None.
Me.textBoxExt1.BorderStyle = BorderStyle.None
'Sets the border style as FixedSingle.
Me.textBoxExt1.BorderStyle = BorderStyle.FixedSingle
'Sets the border style as Fixed3D.
Me.textBoxExt1.BorderStyle = BorderStyle.Fixed3D
'Sets the border raised inner and outer edges.
Me.TextBoxExt3.Border3DStyle = Border3DStyle.Raised
'Sets the border raised outer edge and no inner edge.
Me.TextBoxExt3.Border3DStyle = Border3DStyle.RaisedOuter
'Sets the border raised inner edge and no outer edge.
Me.TextBoxExt3.Border3DStyle = Border3DStyle.RaisedInner
'Sets the edged border appearance of inner edge and outer edge.
Me.TextBoxExt3.Border3DStyle = Border3DStyle.Etched
'Sets the border with no three-dimensional effects.
Me.TextBoxExt3.Border3DStyle = Border3DStyle.Flat
'Sets the border with sunken inner and outer edges.
Me.TextBoxExt3.Border3DStyle = Border3DStyle.Sunken
'Sets the border with sunken inner and no outer edges.
Me.TextBoxExt3.Border3DStyle = Border3DStyle.SunkenInner
'Sets the border with sunken outer and no inner edges.
Me.TextBoxExt3.Border3DStyle = Border3DStyle.SunkenOuter
'Draws the border outside the specified rectangle, preserving the dimension of the rectangle for drawing.
Me.TextBoxExt3.Border3DStyle = Border3DStyle.Adjust
'Shows the border around the TextBoxExt.
Me.textBoxExt2.BorderSides = Border3DSide.All
'Shows the border on top of the TextBoxExt.
Me.textBoxExt2.BorderSides = Border3DSide.Top
'Shows the border at bottom of the TextBoxExt.
Me.textBoxExt2.BorderSides = Border3DSide.Bottom
'Shows the border on left side of the TextBoxExt.
Me.textBoxExt2.BorderSides = Border3DSide.Left
'Shows the border on right side of the TextBoxExt.
Me.textBoxExt2.BorderSides = Border3DSide.Right
'Sets the border color when BorderStyle is set as FixedSingle.
Me.textBoxExt1.BorderColor = Me.colorPickerButton1.SelectedColor

 

Border style specified as None

Figure 1: Border style specified as None

Border style specified as FixedSingle

Figure 2: Border style specified as FixedSingle

Border style specified as Fixed3D

Figure 3: Border style specified as Fixed3D

Border style specified as FixedSingle

Figure 4: Border style specified as FixedSingle

Border 3Dstyle is RaisedOuter

Figure 5: Border3DStyle is RaisedOuter

Border 3Dstyle is RaisedInner

Figure 6: Border3DStyle is RaisedInner

Border 3Dstyle is Raised

Figure 7: Border3DStyle is Raised

Border 3Dstyle is SunkenInner

Figure 8: Border3DStyle is SunkenInner

Border 3Dstyle is SunkenOuter

Figure 9: Border3DStyle is SunkenOuter

Border 3Dstyle is Adjust

Figure 10: Border3DStyle is Adjust

Border 3Dstyle is Flat

Figure 11: Border3DStyle is Flat

Border 3Dstyle is Sunken

Figure 12: Border3DStyle is Sunken

BorderSides specified as All

Figure 13: BorderSides specified as All

BorderSides specified as Top

Figure 14: BorderSides specified as Top

BorderSides specified as Bottom

Figure 15: BorderSides specified as Bottom

BorderSides specified as Left

Figure 16: BorderSides specified as Left

BorderSides specified as Right

Figure 17: BorderSides specified as Right

Samples:

C#: TextBoxExt_Border_Appearance _C#

VB: TextBoxExt_Border_Appearance_VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon