property Property.ItemCollection as Boolean

Retrieves a value that indicates whether the property is an item of a collection.

TypeDescription
Boolean A boolean expression that indicates whether the property is an item of a collection.

If the ItemCollection is True, the Property object contains an element of the collection. The ExPropertiesList control is able to display collections and their elements. When the control finds a property that exports a collection it adds the elements of the collection as child items of the property.  During loading the control uses the NameItemsCollection property to determine the name of each element into collection, if it is a collection of objects. If the ItemCollection is True use the Object property to find the owner collection. For instance, if the collection contains only strings, the items added to browser's list will be numerated. Instead if the collection contains another objects, it uses the NameItemsCollection property to determine the caption that will be displayed on the name column. Let's suppose that we have the following collection:

Dim n As New Collection
n.Add 10
n.Add 20
n.Add 30

When the control browses for the collection n (PropertiesList1.Select n), the elements of collection are not of object type, so the control will not be able to find each element name. Instead, if we have the following sample:

Set rs = CreateObject("ADODB.Recordset")
rs.Open "Orders", "Provider=Microsoft.Jet.OLEDB.3.51;Data Source= D:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB", 3 ' Opens the table using static mode

and we call PropertiesList1.Select rs.Fields, the control will browse the rs.Fields collection. The Fields property of an ADO recordset contains a collection of Field objects. Since each Field object has a property called "Name", the browser will be able to find the element name using the NameItemsCollection property that contains by default: "Name;Caption;Item".  

Here's a screen shot of how the ExPropertiesList browses the Fields collection ( rs.Fields ):

shot6.jpg (27049 bytes)

If we are using the following sample ( make sure that you have set the NameItemsCollection to empty at design time ):

Set rs = CreateObject("ADODB.Recordset")
rs.Open "Orders", "Provider=Microsoft.Jet.OLEDB.3.51;Data Source= D:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB", 3 ' Opens the table using static mode
PropertiesList1.Select rs.Fields