Non-editable HTML text on a form.

Syntax

[<oRef> =] new Text(<container> [,<name expC>])

<oRef>

A variable or property—typically of <container>—in which to store a reference to the newly created Text object.

<container>

The container—typically a Form object—to which you’re binding the Text object.

<name expC>

An optional name for the Text object. If not specified, the Text class will auto-generate a name for the object.

Properties

The following tables list the properties and methods of interest in the Text class. (No particular events are associated with this class.)

Property

Default

Description

alignHorizontal

Left

Determines how the text displays within the horizontal plane of its rectangular frame (0=Left, 1=Center, 2=Right, 3=Justify)

alignment

Top left

Combines the alignHorizontal, alignVertical, and wrap properties (maintained for compatibility)

alignVertical

Top

Determines how the text displays in the vertical plane of its rectangular frame (0=Top, 1=Center, 2=Bottom, 3=Justify)

anchor

0 – None

How the Text object is anchored in its container (0=None, 1=Bottom, 2=Top, 3=Left, 4=Right, 5=Center, 6=Container)

baseClassName

TEXT

Identifies the object as an instance of the Text class

border

false

Whether the Text object is surrounded by the border specified by borderStyle

className

TEXT

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

colorNormal

BtnText/BtnFace

The color of the text

fixed

false

Whether the Text object’s position is fixed or if it can be "pushed down" or "pulled up" by the rendering or suppression of other objects

function

 

A text formatting function

leading

0

The distance between consecutive lines; if 0 uses the font's default leading

marginHorizontal

 

The horizontal margin between the text and its rectangular frame

marginVertical

 

The vertical margin between the text and its rectangular frame

picture

 

Formatting template

prefixEnable

true

Whether to interpret the ampersand (&) character in the text as the accelerator prefix.

rotate

0

The text orientation, in increments of 90 degrees
(0=0, 1=90, 2=180, 3=270)

suppressIfBlank

false

Whether the Text object is suppressed (not rendered) if it is blank

suppressIfDuplicate

false

Whether the Text object is suppressed (not rendered) if its value is the same as the previous time it was rendered

text

<same as name>

The value of the Text object; the text that appears

tracking

0

The space between characters; if zero uses the font’s default

trackJustifyThreshold

0

The maximum amount of added space between words on a fully justified line; zero indicates no limit

transparent

false

Whether the Text object has the same background color or image as its container

variableHeight

false

Whether the Text object’s height can increase based on its value

verticalJustifyLimit

0

The maximum additional space between lines that can be added to attempt to justify vertically. If the limit is exceeded the Text object is top justified. A value of zero means no limit.

wrap

true

Whether to word-wrap the text in the Text object

 

Method

Parameters

Description

getTextExtent( )

<expC>

Returns the width of the specified string using the Text object’s font

 

The following table lists the common properties, events, and methods of the Text class:

Property

 

Event

 

Method

before
borderStyle

dragEffect

fontBold

fontItalic

fontName

fontSize

fontStrikeout

fontUnderline

form

height

hWnd

id
left

mousePointer

name

pageno

parent

printable

speedTip

systemTheme
top

visible

width

beforeRelease
canRender

onClose
onDesignOpen
onDragBegin
onLeftDblClick
onLeftMouseDown
onLeftMouseUp
onMiddleDblClick

onMiddleMouseDown
onMiddleMouseUp

onMouseMove

onOpen

onRender

onRightDblClick

onRightMouseDown

onRightMouseUp

drag( )
move( )

release( )

Description

Use a Text component to display information in a form or report. The text property of the component may contain any text, including HTML tags. Use a TextLabel component in forms where the extended functionality of the Text component is not required.

The text property may be an expression codeblock, which is evaluated every time it is rendered.

Note

The properties, marginHorizontal, marginVertical, suppressfBlank, suppressfDuplicate, tracking, trackJustifyThreshold, verticalJustifyLimit and variableHeight are designed to be used only in reports.