Delete(Index: Integer);
Index. Shape index in the collection.
The Delete method deletes a shape from the collection of selected shapes based on the defined index.
Sub Draw;
Var
UiWorkspace1: UiWorkspace;
Rect : IWxRectangle;
Ellipse : IWxEllipse;
pos : IGxPointF;
SelectS : IWxSelectedShapes;
Begin
UiWorkspace1.WxWorkspace.BeginUpdate;
Rect := UiWorkspace1.WxWorkspace.CreateRectangle;
pos := New GxPointF.Create(20,10);
Rect.PinPosition := pos;
Rect.Text := "Rectangle";
Ellipse := UiWorkspace1.WxWorkspace.CreateEllipse;
pos := New GxPointF.Create(40,50);
Ellipse.PinPosition := pos;
Ellipse.Text := "Ellipse";
SelectS := UiWorkspace1.WxWorkspace.Views.Item(0).SelectedShapes;
SelectS.Add(Rect);
SelectS.Add(Ellipse);
SelectS.Align(WxShapesAlignment.VerticalCenter);
SelectS.Delete(0);
UiWorkspace1.WxWorkspace.EndUpdate;
End Sub Draw;
After executing the example the created objects are aligned to the vertical center, and the rectangle is deselected.
See also: