Enabled property (WinStudio scripts)

Applies To

  • IWSFormComponent interface
  • IWSIDOCollection interface

Definition

Sets or returns a Boolean value indicating whether an IDO collection object or a form component object is read-only.

Set Syntax

object.Enabled = Boolean

  Part   Description
object Required. A reference to an IDO collection or form component object.
Boolean Required. Determines whether the object is enabled:
  • True enables the property; that is, make the object read-write.
  • False disables the property; that is, make the object read-only.

Get Syntax

object.Enabled

  Part   Description
object Required. A reference to an IDO collection or form component object.

Remarks

In the Get syntax, a return value of:

  • TRUE indicates that the Enabled property is active (the object is not read-only).
  • FALSE indicates that the Enabled property is deactivated (the object is read-only).

Example

Sub Main()
   If ThisForm.Components("ScriptButton").Enabled Then
      Application.ShowMessage("The button is enabled. Now disabling it...")
      ThisForm.Components("ScriptButton").Enabled = False
   Else
      Application.ShowMessage("The button is now disabled. Enabling it...")
      ThisForm.Components("ScriptButton").Enabled = True
   End If
End Sub