[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Product Class Structure
    Supported Formats
   [Collapse]Getting Started
     How to: Create the RichEditControl with a Bar UI
     How to: Create the RichEditControl with a Ribbon UI
     How to: Use the Template Gallery to Create the RichEditControl
   [Expand]RichEditControl Document
   [Expand]Fields
    Text Formatting
    Import and Export
   [Expand]Page Layout
    Printing
    Spell Checking
    AutoCorrect Feature
    Mail Merge
    Restrictions and Protection
   [Expand]Visual Elements
    Services
    Events
    Commands
    Keyboard Shortcuts
    HTML Tag Support
   [Expand]Examples
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Create the RichEditControl with a Ribbon UI

This tutorial describes how to create a word processing application with the ribbon UI and adjust its appearance.

In this document:

Note

Check the "Getting Started" tutorial on YouTube: DevExpress WinForms: Rich Text Editor.

Expanded Create a RichEditControl Application

  1. Start Visual Studio and create a new Windows Forms Application project.

  2. Drop the RichEditControl item from the DX.19.1: Rich Text Editor toolbox tab onto the form.

  3. Click the RichEditControl's smart tag and select Dock in Parent Container in the invoked RichEditControl Tasks menu. This allows the RichEditControl to expand to the form's size.

Expanded Create Ribbon Pages

Design Time

  1. Select Create Ribbon in the RichEditControl Tasks menu to add a RibbonControl onto the form.

  2. Select necessary ribbon pages in the RichEditControl Tasks menu or click Create All Bars to add all available rich edit ribbon pages at once. You can customize the created ribbon afterward: change the ribbon style, add new ribbon elements, modify or remove the existing items.

  3. Click the RibbonControl's smart tag and select Convert Form To RibbonForm in the RibbonControl Tasks menu to convert the application form to a RibbonForm.

Runtime

Use the RichEditControl.CreateRibbon method overloads to add a ribbon to the RichEditControl at runtime. Paste this code to the form constructor or to the Load event handler.

Result

Run the Rich Text Editor and view the result. For example, type and format text, insert pictures and explore the various ribbon items.

Note

Commands executed using the Ribbon 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.

Expanded 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.

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

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.

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

  • SVG Icons

  • Bitmap Icons

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.False 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.

As a result, the Open File and Save File dialogs match the application's theme.

Tip

Refer to the Examples section for more examples on how to work with the Rich Text Editor.

Expanded See Also

Is this topic helpful?​​​​​​​