Software Developer's Kit - ChemDraw

Send comments on this topic
Color Property
See Also 


Member of ChemDraw Control.Settings

Sets and returns the color of the object or the foreground color of the document

Property type

Read-write property


Visual Basic
Public Property Color() As ULong

Return Type



When Object.Settings.Color is used, the color property of the object is updated. It enables more colors than the eight colors that are initially available in the color palette. When a color is assigned using Object.Settings.Color, then this color is available with Object.Color.


'Declares variable vObject
 Dim vObject As ChemDrawControl10Ctl.Object
'Checks that there is an Object loaded the variable
 If  Selection.Object.Count < 1 Then
     Exit Sub
 End If

 Private Sub cmdSettingsColor_click() 
    'Sets the Settings.Color
     vObject.Settings.Color = val(Text1.text )

    'Displays the color the settings 
     Text2.text = vObject.Settings.Color 
    'Displays the color of the object 
     Text3.text = vObject.Color
    'the object.color will be updated with each change
    '---- example using the common dialog box --------
    'this indicates that the common dialog will be used with colors
     codColor.Flags = cdlCCRGBInit
     codColor.Color = vObject.Settings.Color

    'this activates the VB common dialog
     codColor.Action = 3
     vObject.Settings.Color= codColor.Color
 End Sub

See Also