Skip to main content

ShapeCollection.Remove(Shape) Method

Removes the specified shape from the collection.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v23.2.Core.dll

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

bool Remove(
    Shape shape
)

Parameters

Name Type Description
shape Shape

A shape to remove.

Returns

Type Description
Boolean

true if the element is found and successfully removed; otherwise, false.

Remarks

The following code example removes all shape groups from the collection:

Document document = wordProcessor.Document;
ShapeCollection shapes = document.Shapes;
for (int i = shapes.Count - 1; i >= 0; i--)
{
    if (shapes[i].Type == ShapeType.Group)
        shapes.Remove(shapes[i]);
}
See Also