Text Property

Returns or sets the text of an the object.

Syntax

Object.Text [ = sText ]

The Text property syntax has the following parts:

 

Name

Type

Description

Object

A control

A control object

sText

BString

String containing the text.

Comments

The Text property behaves a little differently for different controls, as described below:

 

Control

Description

AComboBox

The Text property returns or sets the text of the edit box portion of the combo box. When the Style is acbDropDownList, the text is the selected item in the list box. In that case, the value returned is always equivalent to the value returned by the expression List(ListIndex).

AListBox

The Text property returns the text of selected (caret) item in the list. The value returned is always equivalent to the value returned by the expression List(ListIndex).

ATextBox

The Text property returns or sets the text displayed by the object.

Example

The following statement changes the ATextBox Text property to "Master Form Choices":

tb1.Text="Master Form Choices"

The following example shows how to set the Text property of a MultiLine ATextBox:

lb1.Text = "First line of text\r\nSecond line of text\r\n"

Applies to

 

AComboBox

AListBox

ATextBox

See Also

Caption, Description, MultiLine , Name, Tag