Back to Devexpress

RichEditControlCompatibility.UseThemeFonts Property

officefileapi-devexpress-dot-xtrarichedit-dot-richeditcontrolcompatibility-1b71553b.md

latest4.6 KB
Original Source

RichEditControlCompatibility.UseThemeFonts Property

Specifies whether to use theme fonts to retrieve default document font information.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
[DefaultValue(true)]
public static bool UseThemeFonts { get; set; }
vb
<DefaultValue(True)>
Public Shared Property UseThemeFonts As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true , to retrieve document fonts from themes; otherwise, false.

|

Remarks

In previous versions, the RichEditControlCompatibility.DefaultFontName property allowed you to control the default document font.

With the 19.2 release, the word processing components use document themes to retrieve default document font information. The RichEditControlCompatibility.DefaultFontName property no longer affects 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.

Tip

Set the RichEditBehaviorOptions.UseThemeFonts property (or DXRichEditBehaviorOptions.UseThemeFonts for WPF) to false before loading a new document to disable themes for a specific component.

The following code snippets (auto-collected from DevExpress Examples) contain references to the UseThemeFonts property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-specify-default-font-name-and-size/CS/DefaultDocumentSettingsExample/Form1.cs#L20

csharp
//set the default font for all RichEditControls in the application
RichEditControlCompatibility.UseThemeFonts = false;
RichEditControlCompatibility.DefaultFontSize = 12;

winforms-grid-richedit-highlight-search-results/CS/E4422/Program.cs#L14

csharp
Application.SetCompatibleTextRenderingDefault(false);
RichEditControlCompatibility.UseThemeFonts = false;
Application.Run(new Form1());

how-to-specify-default-font-name-and-size/VB/DefaultDocumentSettingsExample/Form1.vb#L14

vb
'set the default font for all RichEditControls in the application
DevExpress.XtraRichEdit.RichEditControlCompatibility.UseThemeFonts = False
DevExpress.XtraRichEdit.RichEditControlCompatibility.DefaultFontSize = 12

winforms-grid-richedit-highlight-search-results/VB/E4422/Program.vb#L16

vb
Application.SetCompatibleTextRenderingDefault(False)
RichEditControlCompatibility.UseThemeFonts = False
Call Application.Run(New Form1())

See Also

RichEditControlCompatibility Class

RichEditControlCompatibility Members

DevExpress.XtraRichEdit Namespace