Re: unload controls at runtime
Ah, ok. Now it is much clearer what you wanted to do, and the problems you encountered. The method suggested by vb_the_best looks quite suitable to your purpose.
As you found out, you cannot change the index, nor do the array indexes reorder themselves when an element is unloaded.
The only other method which comes to mind at the moment is to loop through the array from one index above the one you want to delete up to the last index, and copying the caption from each one down by one index. Then delete the last index. In this way, your array UBound will always match the number of labels you actually have.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?