Skip to main content
.NET Framework 4.5.2+

ShapeCollection.Remove(Shape) Method

Removes the specified shape from the collection.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

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