Articles in this section
Category / Section

How to highlight text of the following format in the WinForms SyntaxEditor (EditControl)?

2 mins read

Highlight the text

#group XXXX: *%(YYY)

Where XXXX, YYY are Numbers highlighted using Pink color.#group is a GroupSpecifier highlighted using Red color.: < > * are Operators of Category1 highlighted using Navy color (bold).% ( ) are Operators of Category2 highlighted using Green color.POS is a Keyword of Category1 highlighted using Orange color.Prop is a Keyword of Category2 highlighted using Blue color (bold).A configuration file - GroupsConfig.xml which highlights a custom language called GroupsLanguage has been created as per the above rules, and plugged into the EditControl using the following code.

C#

this.editControl1.Configurator.Open(Path.GetDirectoryName(Application.ExecutablePath) + @"\..\..\GroupsConfig.xml");
this.editControl1.ApplyConfiguration("GroupsLanguage");

 

VB

Me.editControl1.Configurator.Open(Path.GetDirectoryName(Application.ExecutablePath) + @"\..\GroupsConfig.xml")
Me.editControl1.ApplyConfiguration("GroupsLanguage")

 

Reference link: https://help.syncfusion.com/windowsforms/syntax-editor/syntax-highlighting#apply-custom-configuration-in-editcontrol

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