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