WPS 加载项开发 > 表格 API 参考 > Shape > 属性 > Shape.ParentGroup 属性
返回 Shape 对象,它代表子形状或子形状区域的共同父形状。

语法

表达式.ParentGroup

表达式   一个代表 Shape 对象的变量。

示例

在此示例中,ET 向活动工作表添加两个形状,然后通过删除组合的父形状来删除这两个形状。

示例代码
function ParentGroup() {
    let pgShape
    let shapes = ActiveSheet.Shapes
    shapes.AddShape(1, 10, 10, 100, 100)
    shapes.AddShape(2, 110, 120, 100, 100)
    shapes.Range([1,2]).Group()

    // Using the child shape in the group get the Parent shape.
    pgShape = ActiveSheet.Shapes.Item(1).GroupItems.Item(1).ParentGroup

    MsgBox("The two shapes will now be deleted.")

    // Delete the parent shape.
    pgShape.Delete()
}


请参阅