Example 5: Dynamically Create Buttons
There are many programming situations where an action requires the creation and population of a collection, passing the collection to another component for processing and finally destroying the collection.
This example shows how to dynamically create a keyed collection of buttons, work with them, and how to then destroy all the buttons from memory:
Collection and Buttons Are Created at Run-Time