Deleting a member from a ListBox Control Set

Hi All,

I used a dynamic control set of canvas, many years ago. I had no problems nor for creating new members, or deleting ones.
Today, I need a Control Set of ListBoxes. No problems for creating dynamically new members, but impossible to destroy them!
I tried
MyListBox(x)=Nil
MyListBox$x=Nil

But each time, I got this error on compilation:

This is a type name, not a variable; values can’t be assigned to it

So, how would you delete a member of a ListBox Control Set?

TIA

MyListbox(0).Close

1 Like

@DerkJ’s method is the way to go. But note that a control set is not an array.

So say you close MylistBox(0), that reference will become nil, instead of (1) being pushed down to (0).

You want to test members before using them, in case they are closed.

2 Likes

Was too simple for me…!!!
It is so obvious!
Many thanks to you, DerkJ!

Got it. Thanks!