Software Developer's Kit - ChemDraw

Send comments on this topic
Delete Method
See Also 

Description

Member of ChemDraw Control.Picture.

Deletes the Picture.

Syntax

Visual Basic
Public Sub Delete() 

Return Type

None

Example

'Declares variable vObject
 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
'To delete the selected object
 
Private sub cmdDelete_Click()
     vMessage = MsgBox("Are you sure you want to delete the selected object?", _
                vbQuestion + vbOKCancel, "Confirm")

     If  vMessage = 1 Then
         vObject.Delete 
     End If
 End Sub

See Also