property Groups.Item (Index as Variant) as Group
Returns a specific Group from the collection.

TypeDescription
Index as Variant A long expression that indicates the group's index, or a string expression that indicates the group's caption.
Group A Group object being retrieved.

Use the Item property to access a given Group object. The Item property is the default property in the Groups object, and Groups.Item(x) is similar with Groups(x). Use the Count property to count the groups in the control. Use the Caption property to get the group's caption. Use the ItemByPos property to access a Group object by its 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