[]
ExpressionEditor supports syntax highlighting to visually distinguish functions and fields within expressions. Color-coded display improves readability and helps differentiate expression elements. The SyntaxHighlighting property of the C1ExpressionEditor class controls whether syntax highlighting is enabled.
Note: Operators and constants are not highlighted.
Syntax highlighting in ExpressionEditor is controlled through the SyntaxHighlighting and IntelliSyntaxHighlightingEnabled properties. Both properties must be enabled for syntax highlighting to function.
Property | Type | Description | Default |
|---|---|---|---|
|
| Enables or disables visual syntax highlighting within the editor. This property requires |
|
|
| Enables or disables the internal syntax-highlighting engine used by the editor. |
|
The following example enables the syntax-highlighting engine and visual syntax highlighting:
// Disable syntax highlighting
c1ExpressionEditor1.SyntaxHighlighting = false;
// Enable syntax highlighting
c1ExpressionEditor1.IntelliSyntaxHighlightingEnabled = true;
c1ExpressionEditor1.SyntaxHighlighting = true;The C1ExpressionEditor control provides a Theme property for customizing the visual appearance of the editor, including syntax-highlighting colors and styles.
The Theme property is declared as an ExpressionEditorTheme object and supports expansion through the ExpandableObjectConverter type converter.
[TypeConverter(typeof(ExpandableObjectConverter))]
public ExpressionEditorTheme Theme { get; set; }The Theme property exposes expandable sub-properties that configure individual visual settings for the editor. At design time, these settings appear as expandable entries in the Visual Studio Properties window.