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 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