ComponentOne Chart 8.0 for ActiveX
Accessing Each of the Elements of a Collection

 

Accessing Each of the Elements of a Collection

Visual Basic enables you to access each of the elements of a collection in turn using the For Each statement. For example, the following code sets the vertical pixel offset (the distance between the center of each chart label and its point of attachment) to 10:

For Each Label in Chart3D1.ChartLabels

       Label.VerticalOffset = 10

Next

Each collection defines a Count property whose value is the current number of objects in the collection. You can use Count to access some or all of the elements of a collection. For example, the following is another way to set the vertical pixel offset for the chart labels:

Dim Counter As Integer

For Counter = 1 To Chart3D1.ChartLabels.Count

       Chart3D1.ChartLabels(Counter).VerticalOffset = 10

Next

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback