Locked Property (ATextBox)

Returns or sets whether the text in the ATextBox object can be edited.

Syntax

Object.Locked [ = bLocked ]

The Locked property syntax has the following parts:

 

Name

Type

Description

Object

ATextBox

ATextBox control

bLocked

Bool

A boolean expression that specifies whether the text in the object can be edited.

Where

bLocked can be one of the following:

 

Value

Description

True

The text of the control cannot be edited.

False *

The text of the control can be edited.

Comments

When the property is set to True, the control text cannot be changed by the user; however the program can still modify the Text property programmatically.

When Locked is True typing and pasting are disabled and the ForeColor, BackColor and control colors are be the same (typically black and gray).

When Locked is False scrolling, selecting, and copying are enabled. To disable them as well use the Enabled property.

Example

The following statement prevents the text in the text box control from being edited by the user:

tbDesc.Locked=True

Applies to

ATextBox

See Also

Enabled