DonnaF Posted June 19, 2003 Posted June 19, 2003 I am creating a listbox from an array. The user wants to be able to key a number in a textbox to designate which item to delete from the listbox and from the array. I can recreate the listbox, deleting the necessary item. For the array, however, I want to delete the item, and bump up the index for the remaining items in the array behind it. Each time the button is clicked, the array should be decreased by the number entered in the textbox. Each time the array will get smaller and smaller. Does anyone have any suggestions on how to easily do this. I know I can use REDIM, but do I need to write a temporary array, delete the items, and then write it back to the original array, using the REDIM? Thanks, Donna Quote
Administrators PlausiblyDamp Posted June 19, 2003 Administrators Posted June 19, 2003 Have you considered using a one of the collection classes instead of an array? ArrayList behaves like an array but also has methods lik RemoveAt which sound like the kind of thing you're after. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.