TCustomRichViewEdit.CurTextStyleNo

<< Click to display table of contents >>

TCustomRichViewEdit.CurTextStyleNo

Index of the current text style in the collection of styles.

property CurTextStyleNo: Integer;

This is an index in the collection Style.TextStyles.

This text style will be used when inserting new text in the document at the position of caret (both by user keyboard input and by methods, such as PasteText or InsertText).

This property is changed when user moves the caret to another text item or edits the document, or when some methods are called. When this property is changed, OnCurTextStyleChanged event occurs.

Value of this property is always positive. To get style (i.e. type) of item at the caret position, use CurItemStyle property.

The editor never sets this property to index of text style having rvprDoNotAutoSwitch in Protection. You can do it yourself to insert a special symbol (by keyboard input, or InsertText), but after that the component automatically switches this property back to the last used style without rvprDoNotAutoSwitch in Protection.

Usually you do not need to assign value to this property directly, use ApplyTextStyle or ApplyStyleConversion instead.

This property must be accessed only when the document is formatted.

This property never returns rvsDefStyle constant. It "translates" it and returns the index of text style that is used for text. If you want to know if the text actually has rvsDefStyle style, use ActualCurTextStyleNo property.

See also methods:

ApplyTextStyle;

ApplyStyleConversion.

See also properties:

CurItemStyle;

CurParaStyleNo;

ActualCurTextStyleNo.

See also events:

OnCurTextStyleChanged.