Skip to content

Specify default formatting options for an individual document or for an entire application.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/how-to-specify-default-font-name-and-size

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Specify Default Document Formatting

This example illustrates two methods to specify default document formatting. The project contains two RichEditControl instances that use different default formatting options.

The main RichEditControl uses parameters specified by the Document.DefaultCharacterProperties and Document.DefaultParagraphProperties options in the RichEditControl.DocumentLoaded event handler.

The New Document button executes the CreateNewDocument method that, in turn, raises the EmptyDocumentCreated event. In the event handler, the document is generated with another set of default settings specified by the Document.DefaultCharacterProperties and Document.DefaultParagraphProperties properties.

The Show New Editor button invokes the other RichEditControl instance that uses default settings specified by the RichEditControlCompatibility.DefaultFontName and RichEditControlCompatibility.DefaultFontSize properties on application startup.

Warning

Starting with v19.2, the RichEditControl uses document themes to retrieve default document font information. As such, the RichEditControlCompatibility.DefaultFontName property will no longer affect the default document font.

Set the RichEditControlCompatibility.UseThemeFonts property to false when starting the application to restore the previous behavior in all instances of the RichEdit components. Set the RichEditBehaviorOptions.UseThemeFonts property to false before loading a new document to disable themes for a specific component.

The Load Text Document button loads a document to both RichEditControl instances. As a result, the document has different format options in each instance.

result

Files to Look At

Documentation

Does this example address your development requirements/objectives?

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

About

Specify default formatting options for an individual document or for an entire application.

Topics

Resources

License

Stars

Watchers

Forks