ISControls.Count

Description

The number of the child controls within the collection.

Syntax

object.Count

Part Attribute Type Description
object Required
The object always implements the ISControls interface
Restriction: This property is readonly.

Return Value

int

Example

Display the number of the child controls within the collection, their captions, short names and type names.

sub main()
  Dim aControls
  Dim aControl
  Dim aControlInfo
  Dim aMessage

  Set aControls =  Form.AllControls
  
  if aControls.Count = 0 then
    aMessage = "There are no controls on the form"
  else
    aMessage = "The number of the controls is " & aControls.Count   
  end if
  
  for each aControl in aControls
    aMessage = aMessage & vbNewLine & " ---------- " & vbNewLine & _ 
      GetControlInfo(aControl) & vbNewLine 
  next                  
  
  Profile.MsgBox(aMessage)
end sub

function GetControlInfo(aControl)
  aControlInfo =_
    "Caption: " & aControl.Caption & vbNewLine &_ 
    "ShortName: " & aControl.ShortName & vbNewLine &_
    "TypeName: " & aControl.TypeName
  GetControlInfo = aControlInfo   
end function   
Note:

In Profile Client v8 on User Interface Controls can be found in Maitain > Templates > Health Record Collection Templates > Open the selected form template > Open form editor > Object Inspector.

Version information

Added in v7.8.0