Software Developer's Kit - ChemDraw

Send comments on this topic
Caption Property
See Also 

Description

Member of ChemDraw Control.AltGroup.

Returns the title caption of this AltGroup

Property type

Read-only property

Syntax

Visual Basic
Public Property Caption() As Caption

Return Type

Remarks

Returns the default properties for the caption of this AltGroup, like color, face, bounds, font family (non-atom-label text objects).  Generally, this property is used to provide a default font property for non chemically significant text.

Example

'Caption properties
 Dim MyAltGroup As ChemDrawControl10Ctl.AltGroup
 Private Sub ChemDrawControl10Ctl_SelectionChanged(ByVal selection As ChemDrawControl10Ctl.IChemDrawSelection)
     If  ChemDrawControl10Ctl.Objects.AltGroups.Count = 1 Then 'Checks if an AltGroup has been drawn
         Set MyAltGroup = ChemDrawControl10Ctl.Objects.AltGroups.Item(1)
         Command1.Enabled = True
     Else
         Command1.Enabled = False
     End If 
 End Sub
 Private Sub Command1_Click()
     MyAltGroup.Caption.Angle = Val(Text1.Text)
     Text1.Text = MyAltGroup.Caption.Angle 'reads the caption angle
     vMessage = InputBox("Change the Text", "[Variable].Caption.text", MyAltGroup.Caption.Text)
     MyAltGroup.Caption.Text = vMessage 'changes the Title of the caption
     MyAltGroup.Caption.Color = &HFF '&HFF is red in hex
     MyAltGroup.Caption.Color = vbBlue 'this is blue in VB code
 End Sub


See Also