What happens if you try to add an item to a Collection that already exists in the Collection?
Let's say you have a Collection full of integers and you try to add an integer that is already in the Collection.
What happens if you try to add an item to a Collection that already exists in the Collection?
Let's say you have a Collection full of integers and you try to add an integer that is already in the Collection.
Simply put if you add an item to a collection twice, it will be in the collection twice. If you add it with a key then that needs to be unique.
If you try to add something with the same key as a key already in the collection, it throws an error (docs). You can add the same object to a collection twice as long as you use different keys for it.
Side note: Microsoft ended all official support for the VB6 development environment nearly four years ago. The runtime remains supported at least through Windows 7 (e.g., so existing apps continue to run). See this other question and its answers for more details.