Within my program I use a control array of a custom user defined control. One of these controls with the index of 0 exists at program start. Others are added and removed during program use.
I am easily able to add new controls, and place them in the correct position using the Load command, and by using a gloabl variable for the index counter.
The problems arise when I need to remove one of the controls. Removing it is not a problem with the Unload command, however, the control array is now missing an element, so that trying to loop through the items causes an error.
As you will imagine, similar errors crop up all the time as items are added and removed and as other functions within the program try to work with the control array.
Can anyone suggest a method of doing this that will remove this problem? I am thinking along the lines of some method of "ReDIMing" the control array, but I have no idea if this can be done or not.
Any help at all would be greatly appreciated.
I am easily able to add new controls, and place them in the correct position using the Load command, and by using a gloabl variable for the index counter.
The problems arise when I need to remove one of the controls. Removing it is not a problem with the Unload command, however, the control array is now missing an element, so that trying to loop through the items causes an error.
As you will imagine, similar errors crop up all the time as items are added and removed and as other functions within the program try to work with the control array.
Can anyone suggest a method of doing this that will remove this problem? I am thinking along the lines of some method of "ReDIMing" the control array, but I have no idea if this can be done or not.
Any help at all would be greatly appreciated.