Required property (WinStudio scripts)

Applies To

IWSFormComponent interface

Definition

Sets or returns the value of the Required attribute.

Get Syntax

object.Required

  Part   Description
object Required. A reference to an editable component object.

Set Syntax

object.GetRequired = Boolean

  Part   Description
object Required. A reference to an editable component object.
Boolean Required. Determines whether the Required attribute is enabled:
  • TRUE: The Required attribute is enabled.
  • FALSE: The Required attribute is disabled.

Remarks

In the Get syntax, a return value of:

  • TRUE indicates that the Required attribute is set for the component.
  • FALSE indicates that the Required attribute is not set.

Example

Sub Main()
   Dim oRequired As String
   oRequired = ""
   If ThisForm.Components("comboBox1").Required Then
       oRequired = "Yes"
   Else
       oRequired = "No"
   End If
   Application.ShowMessage("ComboBox1 a required field?" _
      & vbLf & oRequired)
   If ThisForm.Components("comboBox1").Required Then
      ThisForm.Components("comboBox1").Required = False
      Application.ShowMessage("ComboBox1 is no longer required.")
   Else
      ThisForm.Components("comboBox1").Required = True
      Application.ShowMessage("ComboBox1 is now required.")
   End If
End Sub
Rubriques liées