

| Type | Description | |||
| Index as Long | A long expression that indicates the index of the level being accessed. | |||
| Level | A Level object being accessed. |
The following VB sample enumerates the levels in the chart:
With Gantt1.Chart
Dim i As Long
For i = 0 To .LevelCount - 1
With .Level(i)
Debug.Print .Label
End With
Next
End With
The following C++ sample enumerates the levels in the chart:
CChart chart = m_gantt.GetChart();
for ( long i = 0; i < chart.GetLevelCount(); i++ )
{
CLevel level = chart.GetLevel( i );
OutputDebugString( V2S( &level.GetLabel() ) );
}
where the V2S function converts a Variant expression to a string expression:
static CString V2S( VARIANT* pvtDate )
{
COleVariant vtDate;
vtDate.ChangeType( VT_BSTR, pvtDate );
return V_BSTR( &vtDate );
}
The following VB.NET sample enumerates the levels in the chart:
With AxGantt1.Chart
Dim i As Long
For i = 0 To .LevelCount - 1
With .Level(i)
Debug.Write(.Label())
End With
Next
End With
The following C# sample enumerates the levels in the chart:
for (int i = 0; i < axGantt1.Chart.LevelCount; i++)
{
EXGANTTLib.Level level = axGantt1.Chart.get_Level(i);
System.Diagnostics.Debug.Write(level.Label);
}
The following VFP sample enumerates the levels in the chart:
With thisform.Gantt1.Chart
For i = 0 To .LevelCount - 1
With .Level(i)
wait window nowait .Label
EndWith
Next
EndWith