Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ShapeCollection.Remove(Shape) Method

Removes the specified shape from the collection.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.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