How to customize the border style and appearance in the WinForms TextboxExt?
Customize the border style and appearance
You can customize the border appearance of the WinForms 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
Figure 1: Border style specified as None
Figure 2: Border style specified as FixedSingle
Figure 3: Border style specified as Fixed3D
Figure 4: Border style specified as FixedSingle
Figure 5: Border3DStyle is RaisedOuter
Figure 6: Border3DStyle is RaisedInner
Figure 7: Border3DStyle is Raised
Figure 8: Border3DStyle is SunkenInner
Figure 9: Border3DStyle is SunkenOuter
Figure 10: Border3DStyle is Adjust
Figure 11: Border3DStyle is Flat
Figure 12: Border3DStyle is Sunken
Figure 13: BorderSides specified as All
Figure 14: BorderSides specified as Top
Figure 15: BorderSides specified as Bottom
Figure 16: BorderSides specified as Left
Figure 17: BorderSides specified as Right
Samples:
C#: TextBoxExt_Border_Appearance _C#
VB: TextBoxExt_Border_Appearance_VB
Conclusion
I hope you enjoyed learning about ow to customize the border style and appearance in the WinForms TextboxExt.
You can refer to our WinForms TextBoxExt’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms TextBoxExt documentation to understand how to present and manipulate data.
For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms TextBox and other WinForms components.
If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!