Software Developer's Kit - ChemDraw

Send comments on this topic
TextFrame Property
See Also 

Description

Member of ChemDraw Control.AltGroup.

Returns the bounds of the rectangle drawn around the title of this AltGroup

Property type

Read-write property

Syntax

Visual Basic
Public Property TextFrame() As Rect

Return Type

Remarks

This property enables all the properties of the rectangle bounding the upper portion of the Named Alternative Group, containing the name of the group.  If this property is absent then the bounds are calculated appropriately based on the size of the contents of the named Alternative Group and of the group's name.

Example

'Returns the top and the center of the text frame of this AltGroup
 Dim MyAltGroup As ChemDrawControl10Ctl.AltGroup
 Private Sub ChemDrawControl10Ctl_SelectionChanged(ByVal selection As ChemDrawControl10Ctl.IChemDrawSelection)
     If  ChemDrawControl10Ctl.Objects.AltGroups.Count = 1 Then 'Checks if an AltGroup has been drawn
         Set MyAltGroup = ChemDrawControl10Ctl.Objects.AltGroups.Item(1)
         Command1.Enabled = True
     Else
         Command1.Enabled = False
     End If
 End Sub
 Private Sub Command1_Click()
     vMessage = MsgBox("The top is: " & MyAltGroup.TextFrame.Top, vbInformation + vbOKOnly, "Info")
     vMessage = MsgBox("The center X is: " & MyAltGroup.TextFrame.Center.X & ", the center Y is: " & _ 
           MyAltGroup.TextFrame.Center.Y & ", the center Z is: " & MyAltGroup.TextFrame.Center.Z , & _ 
           vbInformation + vbOKOnly, "Info")
 End Sub


See Also