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 G2antt1.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_g2antt.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 AxG2antt1.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 < axG2antt1.Chart.LevelCount; i++) { EXG2ANTTLib.Level level = axG2antt1.Chart.get_Level(i); System.Diagnostics.Debug.Write(level.Label); }
The following VFP sample enumerates the levels in the chart:
With thisform.G2antt1.Chart For i = 0 To .LevelCount - 1 With .Level(i) wait window nowait .Label EndWith Next EndWith