New to Telerik UI for WinForms? Download free 30-day trial


RadSyntaxEditor responds to changes in its font properties just as any other WinForms control. You can modify the font size and family of the control through the EditorFontSize and EditorFontFamily properties as demonstrated in Example 1.

Example 1: Setting font properties

this.radSyntaxEditor1.SyntaxEditorElement.EditorFontSize = 18f;
this.radSyntaxEditor1.SyntaxEditorElement.EditorFontFamily = new Telerik.WinControls.SyntaxEditor.UI.FontFamily("TimesNewRoman");

Me.RadSyntaxEditor1.SyntaxEditorElement.EditorFontSize = 18.0F
Me.RadSyntaxEditor1.SyntaxEditorElement.EditorFontFamily = New Telerik.WinControls.SyntaxEditor.UI.FontFamily("TimesNewRoman")

These properties, however, will be applied to the line numbers, editor presenter and intelliprompt parts of the control.

WinForms RadSyntaxEditor Customizing the Font

Monospaced Font Optimization

When the used font is Consolas, Courier New or Lucida Console, you can benefit from the monospaced font optimization to boost the performance of the control. To enable this optimization, you need to set the UseMonospacedFontOptimization property to true for RadSyntaxEditorElement.

Example 2: Enabling monospaced font optimization

this.radSyntaxEditor1.SyntaxEditorElement.UseMonospacedFontOptimization = true;         

Me.RadSyntaxEditor1.SyntaxEditorElement.UseMonospacedFontOptimization = True

In this article