Visual Basic Reference

Visual Studio 6.0

Enabled Property

See Also    Example    Applies To

Returns or sets a value that determines whether a form or control can respond to user-generated events.

Syntax

object.Enabled [= boolean]

The Enabled property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list. If object is omitted, the form associated with the active form module is assumed to be object.
boolean A Boolean expression that specifies whether object can respond to user-generated events.

Settings

The settings for boolean are:

Setting Description
True (Default) Allows object to respond to events.
False Prevents object from responding to events.

Remarks

The Enabled property allows forms and controls to be enabled or disabled at run time. For example, you can disable objects that don't apply to the current state of the application. You can also disable a control used purely for display purposes, such as a text box that provides read-only information.

Disabling a Timer control by setting Enabled to False cancels the countdown set up by the control's Interval property.

For a Menu control, Enabled is normally read/write at run time. But Enabled is read-only for menu items that are exposed or supplied by Visual Basic to add-ins, such as the Add-In Manager command on the Add-Ins menu.

Show: