DIAdem Help

Content Type
Programming Language
Current manual

Collection: Controls

Collection: Controls

Collection of all controls of a dialog box or of a tab.

You use the ObjectType property to determine the type of a control. You use the type to access the properties and the methods of the control.

The following example displays the number of controls in the Dialog dialog box:

Call MsgBoxDisp(Dialog.Controls.Count)

The following example displays the number of controls in the Page1 tab:

Call MsgBoxDisp(Page1.Controls.Count)

The following example checks the controls of the Dialog dialog box and sets the width of the existing textboxes to 100:

Dim i
For i = 1 To Dialog.Controls.Count
  If Dialog.Controls(i).ObjectType = "EditBox" Then
    Dialog.Controls(i).Width = 100
  End If 
Next

The following example checks the controls of the Dialog dialog box and sets the color of the texts to red:

If View.Sheets(1).Areas(1).DisplayObjType = "Dialog" Then
  Dim oMyDlg: Set oMyDlg = View.Sheets(1).Areas(1).DisplayObj.Dialog
  For i = 1 To oMyDlg.Controls.Count
    If oMyDlg.Controls(i).ObjectType = "Text" Then
      oMyDlg.Controls(i).ForeColor = RGB(255, 0, 0)
    End If 
  Next
End If

Properties

Count

Methods

Item

Was this information helpful?

Previous

ChnCtrl

Next

Button

Previous

ChnCtrl

Next

Button