GetRichTextStyle method (DataWindows)
Description
Determines whether
selected text or text at the cursor in a RichText column has a specified
formatting.
Controls
DataWindow control
Syntax
1 |
Integer <span>dwcontrol</span>.<span>GetRichTextStyle</span> ( TextStyle <span>style</span>, REF boolean <span>state</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to the DataWindow control |
style |
Value for specifying a text style. Allowable
|
state |
Indicates whether the selected text or |
Return Values
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.
1 |
Integer li_style |
1 |
Boolean lb_state |
1 |
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.