GetTextStyle
PowerScript function
Description
Finds out whether selected text has text styles (such as bold or
italic) assigned to it.
Applies to
RichTextEdit controls
Syntax
1 |
rtename.GetTextStyle ( textstyle ) |
Argument |
Description |
---|---|
rtename |
The name of the RichTextEdit control in which you |
textstyle |
A value of the enumerated datatype TextStyle Bold! Italic! Strikeout! Subscript! Superscript! Underlined! |
Return value
Boolean. Returns true if the selected text is formatted with the
specified text style and false if it is not. If textstyle is null,
GetTextStyle returns null.
Usage
Text can be formatted with more than one text style. To test for
different styles, call GetTextStyle more than once.
Examples
A previously defined structure is an instance variable istr_text for
the current window. The structure contains the boolean fields: b_isBold,
b_isItalic, and b_isUnderlined. This example checks whether the selected
text has these styles and stores true or false values in the structure for
each style:
1 2 3 4 |
istr_text.b_isBold = rte_fancy.GetTextStyle(Bold!) istr_text.b_isItalic = rte_fancy.GetTextStyle(Italic!) istr_text.b_isUnderlined = & rte_fancy.GetTextStyle(Underlined!) |
See also