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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I format the contents of the Edit Control using the Configuration file settings?


This sample demonstrates how to format the contents of the Edit Control using the Configuration file settings.

Please refer to the code snippets below and the sample attached to know how to format the contents of the Edit Control dynamically.


private string BasePath = Path.GetDirectoryName(Application.ExecutablePath) + @"\..\..\Test Files\SQL.txt";

private string ConfigPath = Path.GetDirectoryName(Application.ExecutablePath) + @"\..\..\config.xml";

this.editControl1.ConfigurationChanged += new System.EventHandler(this.editControl1_ConfigurationChanged);

private void editControl1_ConfigurationChanged(object sender, System.EventArgs e)


foreach( FormatManager lang in editControl1.Languages )


Format format = lang[FormatType.KeyWord] as Format;

if( format != null )


format.OnCustomDraw += new CustomSnippetDrawEventHandler(format_OnCustomDraw);




private void format_OnCustomDraw(object sender, CustomSnippetDrawEventArgs e)


string text = e.Text;

text = text.ToLower();

text = text[0].ToString().ToUpper() + text.Substring( 1, text.Length - 1 );

e.Text = text;


private void menuItem8_Click(object sender, System.EventArgs e)







Private BasePath As String = Path.GetDirectoryName(Application.ExecutablePath) + "\..\Test Files\SQL.txt"

Private ConfigPath As String = Path.GetDirectoryName(Application.ExecutablePath) + "\..\config.xml"

Private Sub editControl1_ConfigurationChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles


Dim lang As FormatManager

For Each lang In editControl1.Languages

Dim format As Format = lang(FormatType.KeyWord)

If Not (format Is Nothing) Then

AddHandler format.OnCustomDraw, AddressOf format_OnCustomDraw

End If

Next lang

End Sub

Private Sub format_OnCustomDraw(ByVal sender As Object, ByVal e As CustomSnippetDrawEventArgs)

Dim text1 As String = e.Text

text1 = text1.ToLower()

text1 = text1.Substring(0, 1).ToString().ToUpper() + text1.Substring(1, text1.Length - 1)

e.Text = text1

End Sub

Private Sub menuItem8_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles menuItem8.Click




End Sub

Article ID: Published Date: Last Revised Date: Platform: Control:
323 04/30/2011 07/10/2014 WinForms EditControl
Did you find this information helpful?
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