Group2D.Remove

From Xojo Documentation

Method

Group2D.Remove(Index as Integer)

Supported for all project types and targets.

Removes an object specified by its index.

Example

This example removes the first object, which is the image.

Dim px As PixmapShape
Dim s As StringShape
Dim d As New Group2D
Dim o As New Object2D

px = New PixmapShape(DSC_0343)
d.Append(px)

s = New StringShape
s.Y = 70
s.Text = "This is what I call a REAL car!"
s.TextFont = "Helvetica"
s.Bold = True
d.Append(s)

d.Remove(0)
g.DrawObject(d, 100, 100)



Method

Group2D.Remove(Object as Object2D)

Supported for all project types and targets.

Removes an object specified by its reference.

Example

This example also removes the second item, which is the text.

Dim px As PixmapShape
Dim s As StringShape
Dim d As New Group2D
Dim o As New Object2D

px = New PixmapShape(DSC_0343)
d.Append(px)

s = New StringShape
s.Y = 70
s.Text = "This is what I call a REAL car!"
s.TextFont = "Helvetica"
s.Bold = True
d.Append(s)

d.Remove(d.Item(1))
g.DrawObject(d, 100, 100)