Articles in this section
Category / Section

How to specify borders to the text in the WinForms SyntaxEditor (EditControl)?

1 min read

Text border

The SetTextBorder method sets the border to the specified text range using the FrameBorderStyle and BorderWeight enumerator values.

C#

// Set borders to the specified text range
this.editControl1.SetTextBorder(coordinatePoint1, coordinatePoint2, Color.Red, FrameBorderStyle.Wave, BorderWeight.Double);
// Set borders to the selected text
this.editControl1.SetTextBorder(this.editControl1.Selection.Top, this.editControl1.Selection.Bottom, Color.Red, FrameBorderStyle.Wave, BorderWeight.Double);

 

VB

' Set borders to the specified text range
Me.editControl1.SetTextBorder(coordinatePoint1, coordinatePoint2, Color.Red, FrameBorderStyle.Wave, BorderWeight.Double)
' Set borders to the selected text
Me.editControl1.SetTextBorder(Me.editControl1.Selection.Top, Me.editControl1.Selection.Bottom, Color.Red, FrameBorderStyle.Wave, BorderWeight.Double)

 

The RemoveTextBorder method removes the border from the specified text range.

 

C#

// Remove borders from the specified text range
this.editControl1.RemoveTextBorder(coordinatePoint1, coordinatePoint2);
// Remove borders from the selected text
this.editControl1.RemoveTextBorder(this.editControl1.Selection.Top, this.editControl1.Selection.Bottom);

 

VB

' Remove borders from the specified text range
Me.editControl1.RemoveTextBorder(coordinatePoint1, coordinatePoint2)
' Remove borders from the selected text
Me.editControl1.RemoveTextBorder(Me.editControl1.Selection.Top, Me.editControl1.Selection.Bottom)

 

The border style can be specified using the BorderStyle enumerator that supports values like Dash, Dot, DotDash, Solid, Wave and None.

The border weight can be specified using the BorderWeight enumerator that supports values like Thick, Bold and Double.

 

Reference link: https://help.syncfusion.com/windowsforms/syntaxeditor/appearance#text-border

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied