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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I change the font settings of the Formats in the EditControl programmatically ?

 

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.

C#

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);

}

editControl1.ApplyConfiguration(configlanguage);

}

VB

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

Loop

EditControl1.ApplyConfiguration(configlanguage)

End Sub

End Class

Article ID: Published Date: Last Revised Date: Platform: Control:
371 04/30/2011 07/10/2014 WinForms EditControl
Tags:
Did you find this information helpful?
Comments
Henry Drews Sep 06, 2014
This is an excellent example, but could you also show how to save those changes to the configuration so that the next time it is called it will already have those changes applied.
Reply
Ashwini Jaya Preetha Durai Samy [Syncfusion] Oct 14, 2014
Hi Henry, Thank you for your update, We would like to let you know that while changing the EditControl settings at run time, the settings will not be saved. Only the default settings will be applied while loading the EditControl next time and it will be needed to handle end user level serialization to achieve this requirement. Regards, Ashwini
Add Comment
You must log in to leave a comment

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