Is there a way to do this? Delete a member from a controlSet and pack it up so the indexes remain sequential with no holes?
I tried this and it obviously doesn’t work (won’t compile even)
Dim succeed As Boolean=False
Dim i As Integer
Dim oldHandle As Integer
If index<0 Then index=lastIndex
If index>=0 And index<count Then
oldHandle=ctrl(i).handle
If index=0 And count=1 Then // Only One ctrl
Elseif index=count-1 Then // The Last ctrl
Else
For i=index To Max(index,count-2)
//ctrl(i)=ctrl(i+1)
ctrl(i).Handle=ctrl(i+1).handle
Next i
End If
count=count-1
ctrl(count).handle=oldHandle
ctrl(count).Close
succeed=True
End If
Return succeed
ctrl is the controlset
count is # of items in the set
index is the item to be removed
guess I could create a CloneFrom method in the Control
and use
ctrl(i).CloneFrom(ctrl(i+1))