Articles in this section
Category / Section

How to specify the Line back color in WinForms EditControl?

3 mins read

In WinForms EditControl, user can specify the back color for a particular line using its function named SetLineBackColor. The function contains the following arguments.

 

Line Number: It is helps to specify the line number, for which the BackColor is to be applied.

Full Line: It helps to specify whether the BackColor is applied to the full line or just particular co-ordinates.

Format: It helps to specify the format of the background.

 

The following code example demonstrates the same.

C#

//To set the Line back color of the EditControl
for (int lineNumber = 1; lineNumber <= this.editControl1.PhysicalLineCount; lineNumber++)
{
    this.editControl1.SetLineBackColor(lineNumber, true, this.editControl1.RegisterBackColorFormat(this.colorUIControl1.SelectedColor, Color.Empty));
}

 

VB

'To set the Line back color of the EditControl
For lineNumber As Integer = 1 To Me.editControl1.PhysicalLineCount
 Me.editControl1.SetLineBackColor(lineNumber, True, Me.editControl1.RegisterBackColorFormat(Me.colorUIControl1.SelectedColor, Color.Empty))
Next lineNumber

 

Showing before specifying the line backcolor in EditControl

Figure 1: Before specifying the Line backcolor in EditControl.

Showing after specifying the line backcolor in EditControl

Figure 2: After specifying the Line backcolor in EditControl.


Sample Links:

C#: EditControl_LineColor_C#

VB: EditControl_LineColor_VB

 

Conclusion

I hope you enjoyed learning on how to specify the Line back color in WinForms EditControl.

You can refer to WinForms Syntax Editor feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WinForms Syntax Editor example to understand how to create and manipulate data.

For current customers, you can check out our 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 other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

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