Software Developer's Kit - ChemDraw

Send comments on this topic
Selected Property
See Also 

Description

Member of ChemDraw Control.TLCPlate.

Sets and returns whether this TLCPlate is selected or not.

Property type

Read-write property

Syntax

Visual Basic
Public Property Selected() As Boolean

Return Type

Boolean

Remarks

This property returns True if the object is selected, otherwise returns False. If the property is set to False, the object will no longer be selected.

Example

'Declares variable vObject
'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
    'this event indicates a change in the objects selected 
    'checks that there is an object 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 

'another example
 Private Sub ctlChemDraw_DataChanged()
     If  ChemDrawControl10Ctl.Objects.Count >= 1 And ChemDrawControl10Ctl.Selection.Objects.Count = 1 Then
        'First contact produces an error (there is still no object selected)
         Text1.Text = vObject.Selected
     End If
 End Sub

See Also