We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to apply the Format color for the same start and end text of lexem with nested format in EditControl?

Platform: WPF |
Control: EditControl |
.NET Framework: 4

EditControl consider the Format based on Start and End text of lexem. It separates the codes by space. Nested lexem format color can be applied using its SubLexem property. Here we have considered the [::] as parent lexem and [:] as sub-lexem. The following code demonstrates the same.


Code Example: [Xaml]


<syncfusion:FormatsCollection x:Key="formats">
<!—Set Format Color -->
<syncfusion:EditFormats Foreground="Red" FormatName="FieldsFormat"/>
<syncfusion:EditFormats Foreground="Yellow" FormatName="StringFormat"/>
<!--Field Syntax-->
<syncfusion:Lexem IsMultiline="False" ContainsEndText="False" ParentLexemType="Literals" StartText="::" EndText="::" LexemType="Literals" FormatName="FieldsFormat" />
<syncfusion:Lexem IsMultiline="False" ContainsEndText="False" ParentLexemType="Literals" StartText=":" EndText=":" LexemType="Literals" FormatName="StringFormat" />
<!—For nested lexem-->
<syncfusion:Lexem ContainsEndText="True" IsMultiline="True"  StartText="::" IsRegex="true" EndText="::" LexemType="Literals" FormatName="FieldsFormat">
<syncfusion:Lexem ContainsEndText="False" IsMultiline="False"  StartText=":"  IsRegex="True"  LexemType="Literals" FormatName="StringFormat" />






Sample:  EditControlSample

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile