Skip to main content
A newer version of this page is available. .

How to: Use the Template Gallery to Create the RichEditControl

  • 2 minutes to read

This tutorial demonstrates how to use the DevExpress Template Gallery to automatically create a ready-to-use word processing application with the ribbon user interface and activated spell checking functionality.

  1. In Visual Studio menu, click FILE | New | Project… In the invoked New Project dialog, select DevExpress v18.2 Template Gallery, specify project name and location, and click OK.

    RichEdit_NewProject_TemplateGallery

  2. This will invoke the DevExpress Template Gallery dialog.

    In the WinForms Business Solutions group, click the Word Processing Application thumbnail, confirm the project name and click the Create Project button at the bottom of the dialog.

    RichEdit_BusinessSolutions_NewWPApplication

  3. An MS Office-inspired word processing application is ready now. Run it and view the result. For example, type and format text, insert pictures and explore the various ribbon items.

    RichEdit_GettingStarted_Result

Note

Commands executed using the Ribbon (Bar) user interface can throw unhandled exceptions if a problem occurs. Consider the situation when a document is being saved to a locked or read-only file. To prevent application failure, subscribe to the RichEditControl.UnhandledException event and set the RichEditUnhandledExceptionEventArgs.Handled property to true.

Change the Application’s Appearance

  • Change the application’s skin

    At design time

    In code

    Invoke the DevExpress Project Settings page and select a desired skin in the Skin Options group.

    RichEditControl_GettingStarted_ProjectSettings

    Call the UserLookAndFeel.Default static object’s UserLookAndFeel.SetSkinStyle method:

    
    using DevExpress.LookAndFeel;
    // ...
    UserLookAndFeel.Default.SetSkinStyle("Office 2019 Colorful", "Yale");
    
  • Change the RichEditControl’s skin

    Use the RichEditControl.LookAndFeel property to access an object specifying the control’s look and feel settings.

    
    richEditControl1.LookAndFeel.UseDefaultLookAndFeel = false;
    richEditControl1.LookAndFeel.SkinName = "Office 2016 Colorful";
    
  • Use bitmap or vector icons

    The word processing application uses vector icons by default, which ensures that the application is rendered correctly on high-DPI devices.

    Set the static WindowsFormsSettings.AllowDefaultSvgImages property to DefaultBoolean.False at the application’s startup to make your application use bitmap icons in the GUI.

    
    static void Main() {
        DevExpress.XtraEditors.WindowsFormsSettings.AllowDefaultSvgImages = DevExpress.Utils.DefaultBoolean.False;
        // ... 
    }
    

    The following images illustrate the standard RichEditControl’s ribbon UI with default vector and bitmap icons:

    SVG Icons
    RichEditControl_Ribbon_SVG
    Bitmap Icons
    RichEditControl_Ribbon_Bitmap
  • You can disable or hide any command button on a ribbon tab by specifying restriction settings. Set the required properties of the RichEditBehaviorOptions (RichEditControl.Options.Behavior) and DocumentCapabilitiesOptions (RichEditControl.Options.DocumentCapabilities) objects to the DocumentCapability value to solve this task.
See Also