Vcl.ComCtrls.TCustomRichEdit.DefAttributes

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property DefAttributes: TTextAttributes read FDefAttributes write SetDefAttributes;

C++

__property TTextAttributes* DefAttributes = {read=FDefAttributes, write=SetDefAttributes};

Properties

Type Visibility Source Unit Parent
property public
Vcl.ComCtrls.pas
Vcl.ComCtrls.hpp
Vcl.ComCtrls TCustomRichEdit

Description

Describes the rich text characteristics of the default font for the rich edit control

Use DefAttributes to discover or set the default font characteristics that the rich edit control uses for newly inserted text. These are the characteristics of the text before any special attributes have been applied. Once any special attributes are applied to a portion of text, no text from that point on is considered to have the default attributes, even if the attributes match the DefAttributes.

For example, if a rich edit control has had no attributes applied, the entire text has the default attributes. Selecting a portion of text in the middle and applying a specific attribute (such as a font change) results in three sections: a first section with the default attributes, a middle section with the applied attribute, and a final section with a non-default set of attributes that match the default attributes. Changing the DefAttributes property affects only the first section.

When inserting new text, the font characteristics of the new text will match the font characteristics at the cursor position, or, if the typing replaces a selection, the font characteristics of the selected text. New text will only have the default attributes when typed into the section of text that has the default attributes.

Note: DefAttributes is available only at runtime.

See Also

Code Examples