DELETE SHAPE ARRAY - i'm on vb6

User avatar
sal21
PlatinumLounger
Posts: 4554
Joined: 26 Apr 2010, 17:36

DELETE SHAPE ARRAY - i'm on vb6

Post by sal21 »

I just have a series of shape (array), similar:

shp(0)
shp(1)
...
shp(n)

i need to delete all shape from shp(1) to the and of list, possible, maintain shp(0)

User avatar
HansV
Administrator
Posts: 79890
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: DELETE SHAPE ARRY - i'm on vb6

Post by HansV »

Does this work?

Code: Select all

    Dim i As Long
    For i = shp.UBound To 1 Step -1
        Unload shp(i)
    Next i
Best wishes,
Hans

User avatar
SpeakEasy
5StarLounger
Posts: 703
Joined: 27 Jun 2021, 10:46

Re: DELETE SHAPE ARRY - i'm on vb6

Post by SpeakEasy »

Do you have control array, or an array of controls?

User avatar
sal21
PlatinumLounger
Posts: 4554
Joined: 26 Apr 2010, 17:36

Re: DELETE SHAPE ARRY - i'm on vb6

Post by sal21 »

Array of controls

User avatar
sal21
PlatinumLounger
Posts: 4554
Joined: 26 Apr 2010, 17:36

Re: DELETE SHAPE ARRY - i'm on vb6

Post by sal21 »

HansV wrote:
12 Jun 2024, 18:55
Does this work?

Code: Select all

    Dim i As Long
    For i = shp.UBound To 1 Step -1
        Unload shp(i)
    Next i
Hi Bro. Tks.
I can use the same code for text box(0), text box(1), ecc?

User avatar
HansV
Administrator
Posts: 79890
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: DELETE SHAPE ARRY - i'm on vb6

Post by HansV »

Did the code work? If so, yes.
Best wishes,
Hans

User avatar
SpeakEasy
5StarLounger
Posts: 703
Joined: 27 Jun 2021, 10:46

Re: DELETE SHAPE ARRY - i'm on vb6

Post by SpeakEasy »

If it works, then you have a control array, not an array of controls.