property Groups.Count as Long
Returns the number of objects in the collection.

TypeDescription
Long A long expression that specifies the count of Group objects into Groups collection.

Counts the Group objects in the Groups collection. Use the Item property to access the group giving its index or caption. Use the Caption property to get the group's caption. Use the Index property to specify the index of the group. Use the ItemByPos property to retrieve a group by its position. Use the Position property to specify the group's position.

The following VB sample enumerates the groups in the control:

With ExplorerBar1.Groups
    Dim i As Long
    For i = 0 To .Count - 1
        With .Item(i)
            Debug.Print (.Caption)
        End With
    Next
End With

The following VB sample enumerates the groups in the control:

Dim g As EXPLORERBARLibCtl.Group
For Each g In ExplorerBar1.Groups
    Debug.Print g.Caption
Next

The following C++ sample enumerates the groups in the control:

CGroups groups = m_explorerbar.GetGroups();
for ( long i = 0; i < groups.GetCount(); i++ )
{
	CGroup group( groups.GetItem( COleVariant( long(i) ) ) );
	OutputDebugString( group.GetCaption() );
}

The following VB.NET sample enumerates the groups in the control:

With AxExplorerBar1.Groups
    Dim i As Integer
    For i = 0 To .Count - 1
        With .Item(i)
            Debug.WriteLine(.Caption)
        End With
    Next
End With

The following VB.NET sample enumerates the groups in the control:

Dim g As EXPLORERBARLib.Group
For Each g In AxExplorerBar1.Groups
    Debug.WriteLine(g.Caption)
Next

The following C# sample enumerates the groups in the control:

for (int i = 0; i < axExplorerBar1.Groups.Count; i++)
{
	EXPLORERBARLib.Group g = axExplorerBar1.Groups[i];
	System.Diagnostics.Debug.WriteLine(g.Caption);
}

The following VFP sample enumerates the groups in the control:

With thisform.ExplorerBar1.Groups
    local i
    For i = 0 To .Count - 1
        With .Item(i)
            wait window nowait .Caption
        EndWith
    Next
EndWith