Software Developer's Kit - ChemDraw

Send comments on this topic
SelectionChanged Event
See Also 
selection
Indicates the objects selected.

Description

Member of ChemDrawCtl.

Triggers selection change event.

Syntax

Visual Basic
Public Event SelectionChanged( _
   ByVal selection As selection _
)

Parameters

selection
Indicates the objects selected.

Remarks

The selection changed event is triggered by a change in the objects selected.

Example

'Object can be any ChemDraw object
 Dim vObject As ChemDrawControl10Ctl.Object
'Checks that there is an object loaded in the variable
 If  Selection.Objects.Count < 1 Then
     Exit Sub
 End If

 Private Sub ctlChemDraw_SelectionChanged (ByVal selection As ChemDrawControl10Ctl.IChemDrawSelection
    'indicates a change in the objects selected (checks that object is loaded in the variable)
     If  Selection.Objects.Count < 1 OR Selection.Objects.Count > 2 Then
         Exit Sub
     Else
         Set
vObject =  ctlChemDraw.Selection.Objects.Item(1)
     End If
 End Sub 

See Also