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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use the configuration file as an embedded resource in WinForms SyntaxEditor (EditControl) application?

Platform: WinForms |
Control: EditControl |
Published Date: April 30, 2011 |
Last Revised Date: December 12, 2019

Adding configuration file

1. Include the configuration file - DefaultEditorConfig.xml in the project using the VS.NET designer and set its BuildAction property to Embedded Resource in the properties grid.

2. Use the following method to access the config file stream from the resources.


private Stream LoadConfigFromResource(string configFileName)
    Assembly assembly;
    Stream configStream = null;
        assembly = Assembly.GetExecutingAssembly();
        configStream = (Stream)assembly.GetManifestResourceStream("SimpleEdit." + configFileName);
    catch(Exception ex)
    return configStream;



Private Function LoadConfigFromResource(ByVal configFileName As String) As Stream
    Dim assembly As Assembly
    Dim configStream As Stream = Nothing
        assembly = Assembly.GetExecutingAssembly()
        configStream = CType(assembly.GetManifestResourceStream("SimpleEdit." + configFileName), Stream)
    Catch ex As Exception
    End Try
    Return configStream
End Function


3. Apply the config file stream using the following code.



Stream configStream = LoadConfigFromResource("DefaultEditorConfig.xml");



Dim configStream As Stream = LoadConfigFromResource("DefaultEditorConfig.xml")


2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile