Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 3.03 KB

File metadata and controls

35 lines (22 loc) · 3.03 KB

Rich Text Editor for WinForms - How to Replace Standard Command with Custom Command

This example illustrates the technique used to modify the functionality of existing RichEdit commands.

Implementation Details

The RichEditControl exposes the IRichEditCommandFactoryService interface that enables you to substitute the default command with a custom command.

  1. Create a command class, inherited from the command that you've decided to replace. Override its methods. The main functionality and command specifics is located in the Execute or the ExecuteCore method (the latter does not check for the command availability).

  2. Create a IRichEditCommandFactoryService implementation. Override the CreateCommand method to create an instance of a custom command class if an identifier of a certain command is passed as a parameter. So, instead of the default command, a custom command is used by the RichEditControl.

Finally we use this class to substitute the default RichEditControl's service.

Files to Review

Documentation

Does This Example Address Your Development Requirements/Objectives?

(you will be redirected to DevExpress.com to submit your response)