GetRichTextStyle

Description

Determines whether selected text or text at the cursor in a RichText column has a specified formatting.

Applies to

DataWindow control

Syntax

Integer dwcontrol.GetRichTextStyle ( TextStyle style, REF boolean state )

Argument

Description

dwcontrol

A reference to the DataWindow control

style

Value for specifying a text style. Allowable values are:

bold!
italic!
strikeout!
subscript!
superscript!
underlined!

state

Indicates whether the selected text or text at the cursor position has a style applied to it


Return value

Returns an integer to indicate whether the column that you selected has the RichText edit style and whether the content has one or more styles applied.

0 -- Success

-1 -- No RichText column is being edited

-2 -- The selected text is a mix of styles

Usage

You can call this method from a button in a custom toolbar that you use to obtain the current font settings for columns with the RichText edit style.

Examples

This example determines whether a bold font is the current style setting for editing columns with a RichText edit style.

Integer li_style
Boolean lb_state
li_style = dw_1.GetRichTextStyle(bold!, lb_state)

If bold text is selected when the above script is called, the lb_state argument is true, and the method returns 0. If mixed text is selected, such as bold and italic, lb_state is true, and the method returns -2.

See also

GetRichTextAlign

GetRichTextColor

GetRichTextFaceName

GetRichTextSize

SetRichTextStyle