property Groups.ItemByPos (Position as Long) as Group
Retrieves the group given its position.

TypeDescription
Position as Long A long expression that indicates the position of the requested group
Group A Group object being retrieved.
Use the ItemByPos property to access the Group object by its position. Use the Position property to specify the group's position. Use the Caption property to get the group's caption. Use the Item property to access a given Group object. Use the Count property to count the groups in the control.

The following VB sample enumerates the groups in the control, as they are displayed:

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

The following C++ sample enumerates the groups in the control, as they are displayed:

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

The following VB.NET sample enumerates the groups in the control, as they are displayed:

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

The following C# sample enumerates the groups in the control, as they are displayed:

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

The following VFP sample enumerates the groups in the control, as they are displayed:

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