Remove(Value: IWxShape);
Value. Shape
The Remove method removes the specified shape from the collection of selected shapes.
Executing the example requires a form with the Button1 button, the WorkspaceBox component and the UiWorkspace component named UiWorkspace1, which is a data source for WorkspaceBox.
Add links to the Andy, Drawing, Workspace system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
ws: IWxWorkspace;
Rect: IWxRectangle;
Ellipse: IWxEllipse;
pos: IGxPointF;
SelectS: IWxSelectedShapes;
Begin
ws := UiWorkspace1.WxWorkspace;
ws.BeginUpdate;
Rect := ws.CreateRectangle;
pos := New GxPointF.Create(20, 10);
Rect.PinPosition := pos;
Rect.Text := "Rectangle";
Ellipse := ws.CreateEllipse;
pos := New GxPointF.Create(40, 50);
Ellipse.PinPosition := pos;
Ellipse.Text := "Ellipse";
SelectS := ws.Views.Item(0).SelectedShapes;
SelectS.Add(Rect);
SelectS.Add(Ellipse);
SelectS.Align(WxShapesAlignment.VerticalCenter);
SelectS.Remove(Ellipse);
ws.EndUpdate;
End Sub Button1OnClick;
After executing the example the created objects are aligned to the vertical center, and the ellipse is deselected.
See also: