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 ListBar1.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 EXLISTBARLibCtl.Group
For Each g In ListBar1.Groups
    Debug.Print g.Caption
Next

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

CGroups groups = m_listbar.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 AxListBar1.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 EXLISTBARLib.Group
For Each g In AxListBar1.Groups
    Debug.WriteLine(g.Caption)
Next

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

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

The following VFP sample enumerates the groups in the control:

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