Text
Text$
Specifies or retrieves the text associated with the control
String property
Applies to: Generic , Grid , GridCell , MenuItem , TabbedItem
Text$
Get text of a list item
Read-only String property
Applies to: ListItem
Introduced in KCML version 5.03
Text$
Specifies the label used by the tree item
Runtime-only String property
Applies to: TreeItem
Introduced in KCML version 5.02
This property supplies the text string representing the label of a control, the title of the form, or the text of a menu item, list item, tree item or tab page.
For example, to change the text on a button from Stop to Go you could do the following:
.btnControl1.Text$ = "Go"
And to retrieve the current label text from a button you could use:
CurrentTitle$ = .btnControl1.Text$
For controls that support accelerator keys it is also possible to set the accelerator key for a control by inserting an ampersand before the required accelerator character. For example:
.btnControl1.Text$ = "&My Button"
Note: Escape sequences such as "\n" will be interpreted by kclient if set at design time. To avoid this escape the backslash using for example "\\n". This issue does not arise when setting Text$ at run time.
Use with a list Box
This property refers to the text which appears in the listbox for an item. The listbox Add() method can be used to set the text for a listitem at the time the item was being added to the list.
The Text$ property is often used with object references to listbox item as in
OBJECT c = .listControl1.First WHILE OBJECT c <> NULL DO IF (STR(c.Text$,,1) == "x") STR(c.Text$,,1) = "X" END IF OBJECT c = c.Next WEND
Use with a tree
This string property allows access to the label displayed against a node in the tree. It can be used to inspect it or to set it to a new value. Typically it is used by programmers to associate a database key or some other identifier with the the node so that it can be recalled if the user selects the node. The property can be applied to either an object reference to an existing tree node or the Item() method and the existing node's index.
.treeControl1.Item(NodeIndex).Text$ = "This node has index " & NodeIndex