property ConditionalFormats.Item (Key as Variant) as ConditionalFormat
Returns a specific expression.

TypeDescription
Key as Variant A long expression that indicates the index of the element being accessed, or a string expression that indicates the key of the element being accessed.
ConditionalFormat A ConditionalFormat object being returned.
Use the Item and Count property to enumerate the elements in the collection. Use the Expression property to get the expression of the format. Use the Key property to get the key of the format.

The following VB sample enumerates all elements in the ConditionalFormats collection:

Dim c As ConditionalFormat
For Each c In G2antt1.ConditionalFormats
    Debug.Print c.Expression
Next

The following VB sample enumerates all elements in the ConditionalFormats collection:

Dim i As Integer
With G2antt1.ConditionalFormats
    For i = 0 To .Count - 1
        Debug.Print .Item(i).Expression
    Next
End With

The following C++ sample enumerates all elements in the ConditionalFormats collection:

for ( long i = 0; i < m_g2antt.GetConditionalFormats().GetCount(); i++ )
{
	CConditionalFormat cf = m_g2antt.GetConditionalFormats().GetItem( COleVariant( i ) );
	OutputDebugString( cf.GetExpression() );
}

The following VB.NET sample enumerates all elements in the ConditionalFormats collection:

Dim c As EXG2ANTTLib.ConditionalFormat
For Each c In AxG2antt1.ConditionalFormats
    System.Diagnostics.Debug.Write(c.Expression)
Next

The following VB.NET sample enumerates all elements in the ConditionalFormats collection:

Dim i As Integer
With AxG2antt1.ConditionalFormats
    For i = 0 To .Count - 1
        System.Diagnostics.Debug.Write(.Item(i).Expression)
    Next
End With

The following C# sample enumerates all elements in the ConditionalFormats collection:

foreach (EXG2ANTTLib.ConditionalFormat c in axG2antt1.ConditionalFormats)
	System.Diagnostics.Debug.Write(c.Expression);

The following C# sample enumerates all elements in the ConditionalFormats collection:

for (int i = 0; i < axG2antt1.ConditionalFormats.Count; i++)
	System.Diagnostics.Debug.Write(axG2antt1.ConditionalFormats[i].Expression);

The following VFP sample enumerates all elements in the ConditionalFormats collection:

with thisform.G2antt1.ConditionalFormats
	for i = 0 to .Count - 1
		wait .Item(i).Expression
	next
endwith