TextStyle Property

Applies to TestComplete 15.47, last modified on January 20, 2023

Specifies the font style.

Declaration

TcxEditStyleObj.TextStyle
Read-Write Property Variant
TcxEditStyleObj     A TcxEditStyle object  

Description

Use the TcxEdit.Style.TextStyle property to get or set the font style of the component’s text. The font style is a combination of style attributes that specify whether the text characters are bold-faced, italicized, underlined, struck through.

Return Value

One of the constants listed in the following table, or their combination:

Constant Description
"fsBold" or 1 A bold-faced font.
"fsItalic" or 2 An italic font.
"fsUnderline" or 4 An underlined font.
"fsStrikeOut" or 8 A strikethrough font.

To assign a combination of integer values to the property, use the bitwise OR operator:

JavaScript, JScript

UserForms.MyForm.cxTextEdit1.Style.TextStyle = 1 | 4;

Python

UserForms.MyForm.cxTextEdit1.Style.TextStyle = 1 | 4

VBScript

UserForms.MyForm.cxTextEdit1.Style.TextStyle = 1 Or 4

DelphiScript

UserForms.MyForm.cxTextEdit1.Style.TextStyle := 1 or 4;

C++Script, C#Script

UserForms["MyForm"]["cxTextEdit1"]["Style"]["TextStyle"] = 1 | 4;

To assign a combination of constant names to the property, separate them by a comma or space and optionally enclose the resulting string in square brackets. For example:

UserForms.MyForm.cxTextEdit1.TextStyle = "fsBold,fsUnderline";
UserForms.MyForm.cxTextEdit1.Style.TextStyle = "fsBold fsUnderline";
UserForms.MyForm.cxTextEdit1.Style.TextStyle = "fsBold, fsUnderline";
UserForms.MyForm.cxTextEdit1.Style.TextStyle = "[fsBold,fsUnderline]";
UserForms.MyForm.cxTextEdit1.Style.TextStyle = "[fsBold fsUnderline]";
UserForms.MyForm.cxTextEdit1.Style.TextStyle = "[fsBold, fsUnderline]";

Remarks

To set the TextStyle property from the User Forms editor, set the property flags to the appropriate values (True or False). The User Forms editor shows the resulting property value as a combination of style attributes separated by commas and enclosed in square brackets.

Highlight search results