How to: Use the Template Gallery to Create a RichEditControl

  • 3 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.

Create a RichEditControl Application

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

  2. In the WinForms Business Solutions group, click the Word Processing Application thumbnail, confirm the project name and click Create Project.

    RichEdit_BusinessSolutions_NewWPApplication

  3. Run the word processing application 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");

Use Bitmap or Vector Icons

The newly create word processing application uses vector icons. This 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 use bitmap icons in you application.


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

TIP

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.

Use Skinned Open/Save File Dialogs

You can replace standard WinForms Open File and Save File dialogs with skinned DevExpress counterparts.

Set the static WindowsFormsSettings.UseDXDialogs property to DefaultBoolean.True at the application's startup to enable skinned dialogs in your application.

NOTE

Add the required assembly references to use skinned DevExpress dialogs. Refer to the Deployment topic for more information.

static void Main()
{
    DevExpress.XtraEditors.WindowsFormsSettings.UseDXDialogs = DefaultBoolean.True;
    // ...
}

IMAGE

See Also