Articles in this section
Category / Section

How to change the font settings of the Formats in WinForms SyntaxEditor (EditControl) programmatically?

1 min read

Font settings

It is possible to change the font settings of the Formats in the EditControl programmatically using the ISnippetFormat.Font property as shown in code snippets below.


private void ApplyFont()
   SnippetFormat format;
   Config c=this.editControl1.Configurator;
   IConfigLanguage configlang=c.GetLanguage("cs");
   ConfigLanguage configlanguage=configlang as ConfigLanguage;
   for( int i = 0, len = configlanguage.Count; i < len; i++ )
      format = configlanguage[ i ] as ISnippetFormat;
      format.Font =new Font(this.newfont,fontstyle);



Private Sub ApplyFont()
    Dim format As Syncfusion.Windows.Forms.Edit.Interfaces.ISnippetFormat
    Dim c As Syncfusion.Windows.Forms.Edit.Implementation.Config.Config =  Me.EditControl1.Configurator
    Dim configlang As Syncfusion.Windows.Forms.Edit.Interfaces.IConfigLanguage = c.GetLanguage("vb")
    Dim configlanguage As Syncfusion.Windows.Forms.Edit.Implementation.Config.ConfigLanguage = CType(IIf(TypeOf configlang Is ConfigLanguage, configlang, Nothing), ConfigLanguage)
    Dim i As Integer = 0
    Dim len As Integer = configlanguage.Count
    Do While i < len
         format = CType(IIf(TypeOf configlanguage(i) Is Syncfusion.Windows.Forms.Edit.Interfaces.ISnippetFormat, configlanguage(i), Nothing), ISnippetFormat)
         format.Font = New Drawing.Font(Me.newfont, fontstyle)
         i += 1
     End Sub
End Class


Reference link:

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Please sign in to leave a comment