property Chart.LevelCount as Long
Specifies the number of levels in the control's header.

 TypeDescription 
   Long A Long expression that indicates the number of levels being displayed in the control's header.  
By default, the control displays a single level. Use the LevelCount property to specify the number of levels being displayed in the chart's header. Use the Level property to access the level in the chart area. Use the HeaderVisible property to hide the control's header bar. The control's header bar displays the levels in the chart area too. Use the Caption property to specify the column's caption being displayed in the control's header bar. Use the BackColorLevelHeader property to specify the background color of the chart's header. Use the ForeColorLevelHeader property to specify the foreground color of the chart's header. If the control displays the header bar using multiple levels the HeaderHeight property gets the height in pixels of a single level in the header bar. Use the LevelKey property to specify the key of the column.

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

 


Send comments on this topic.
© 1999-2006 Exontrol Inc, Software. All rights reserved.