Software Developer's Kit - ChemDraw

Send comments on this topic
Item Method
See Also 
index

The location of an object in a collection, counted from the top, starting with 1.

Description

Default member of ChemDraw Control.Styles

Given an index, returns one style from the styles collection.

Syntax

Visual Basic
Public Function Item( _
   ByVal index As Long _
) As Style

Parameters

index

The location of an object in a collection, counted from the top, starting with 1.

Return Type

Style

Remarks

Working with this property, allows referencing any given style of a collection of styles, and all the style properties are available.

MyStyles.Item(i).Color:   returns or sets the color of the style
MyStyles.Item(i).Face:    returns or sets the face of the style

Example

'Declares variables 
 Dim myStyles As ChemDrawControl11Ctl.Styles
 Set myStyles = ctlChemDraw.Selection.Objects.Styles

 Private Sub cmdStyles_Click()
    'returns the application of the Styles collection
     Text1.text = MyStyles.Application
    'returns the number of Styles in the Styles collection
     Text2.text = MyStyles.Count 
    'sets the Item(1) of the Styles collection 
     myStyles.Item(1).Face = kCDFontStyleBold
 End Sub

See Also