Software Developer's Kit - ChemDraw

Send comments on this topic
Right Property
See Also 


Member of ChemDraw Control.Rect.

Sets and returns the right side of this rectangle.

Property type

Read-write property


Visual Basic
Public Property Right() As Double

Return Type



Right sets and returns the coordinate to the right line of the rectangle, such as that bounding an object. Right is expressed in points and when working on the same object, the value returned from right is equivalent to:

BottomRight.X or TopRight.X * 20. 


'This example illustrates the use of Rect Properties
'Declares the variables

 Dim myObjectAs ChemDrawControl10Ctl.Object
 Dim vObject As ChemDrawControl10Ctl.Object
 Dim myRectAs ChemDrawControl10Ctl.Rect
'Checks that there is an object loaded in the variable
 If  Selection.Objects.Count < 1 Then
     Exit Sub
 End If

'Works with one object (could be any ChemDraw object)
 For Each myObject In Selection.Objects
     If  myObject.Selected = True Then
vObject = myObject
     End If
Private Sub cmdRectProperties_Click()
    Set myRect = vObject.Bounds
   'Shows the properties of Rect - using the rectangle that bounds an object
    Label2.Caption = "Rect coordinates that return values in IntermCoords" + Chr$(13) + _
       Format(myRect.Bottom, "0.0") + Chr$(13) + _
       Format(myRect.Height, "0.0") + Chr$(13) + _
       Format(myRect.Left, "0.0") + Chr$(13) + _
       Format(myRect.Right, "0.0") + Chr$(13) +_
       Format(myRect.Top, "0.0") + Chr$(13) + _
       Format(myRect.Width, "0.0") + Chr$(13)
   'Applies the IsEmpty property:Returns False if Rect contains an object
    Text1.Text = myRect.IsEmpty
End Sub

See Also