Non-editable text on a form.

Syntax

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

<oRef>

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

<container>

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

<name expC>

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

Properties

The following tables list the properties and methods of interest in the TextLabel 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)

alignVertical

Top

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

baseClassName

TEXTLABEL

Identifies the object as an instance of the TextLabel class

className

(TEXTLABEL)

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

prefixEnable

true

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

text

<same as name>

The value of the TextLabel object; the text that appears

transparent

false

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

 

Method

Parameters

Description

getTextExtent( )

<expC>

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

 

The following table lists the common properties, events, and methods of the TextLabel 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
onClose

onDesignOpen

onDragBegin

onLeftDblClick

onLeftMouseDown

onLeftMouseUp

onMiddleDblClick

onMiddleMouseDown
onMiddleMouseUp

onMouseMove

onOpen

onRightDblClick

onRightMouseDown

onRightMouseUp

drag( )
move( )

release( )

Description

Use a TextLabel component to display information on a form or report, wherever features such as word-wrap and HTML formatting are not required. TextLabel is a simple, light-duty object which consumes fewer system resources than the Text component.

The TextLabel component does not support in-place editing on design surfaces.

The text property of the TextLabel component may contain character string data only.