Software Developer's Kit - ChemDraw

Send comments on this topic
BracketType Property
See Also 

Description

Member of ChemDraw Control.Bracket.

Sets and returns the type of this bracket.

Property type

Read-write property

Syntax

Visual Basic
Public Property BracketType() As CDBracketType

Return Type

Remarks

Sets and returns type of bracket.

Example

'Declares variables
 Dim vbracket1 As ChemDrawControl10Ctl.bracket
 Dim vbracket2 As ChemDrawControl10Ctl.bracket  
 Dim BracketNum As
Boolean

'Checks that there is a bracket loaded in the variable
 Private Sub ctlChemDraw_SelectionChanged(ByVal selection _ 
         As ChemDrawControl10Ctl.IChemDrawSelection) 
     If  Selection.brackets.Count < 1 OR Selection.Brackets.Count > 2 Then
         Exit Sub
     Else
         If 
Selection.Brackets.Count = 1 Then 
             BracketNum = False
             Set vbracket1 =  ctlChemDraw.Selection.Objects.Brackets.Item(1)
         Else 
             BracketNum = True
             Set
vbracket1 =  ctlChemDraw.Selection.Objects.Brackets.Item(1)
             Set vbracket2 =  ctlChemDraw.Selection.Objects.Brackets.Item(2)
         End If
     End If
 End Sub 

 Private Sub cmdBracketSquare_Click()
     vBracket1.BracketType = kCDBracketTypeSquare
     If  BracketNum = True Then 'if 2 brackets are selected
         vBracket2.BracketType = kCDBracketTypeSquare
     End If
 End Sub
 Private Sub cmdBracketCurly_Click()
     vBracket1.BracketType = kCDBracketTypeCurly
     If  BracketNum = True Then 'if 2 brackets are selected
         vBracket2.BracketType = kCDBracketTypeCurly
     End If
 End Sub
 Private Sub cmdRound_Click()
     vBracket1.BracketType = kCDBracketTypeRound
     If  BracketNum = True Then 'if 2 brackets are selected
         vBracket2.BracketType = kCDBracketTypeRound
     End If
 End Sub

See Also