I have pre-defined several Dictionaries (with KeyPairValue elements) in a form's OnLoad event sub. I then added each dictionary to a collection that is defined outside the methods so that it is accessible between the form's subroutines. So far so good.
I would like to use this object to create String arrays to use as DataSources for several different ComboBoxes. In order to do this, I want to retrieve the key names that I previously assigned to the elements of the dictionaries within this collection. I would like to do this by looping through the elements of a specific dictionary within the collection and retrieving the key name. However, I am unable to figure out exactly how to retrieve the keyname. Here is what I am trying:
Collection.Item("Dictionary1")(counter).Key
What I am aiming to get at is, there is a collection of Dictionaries ("Dictionary1", "Dictionar2", etc.) which I can look-up by name. Once the dictionary is selected, I want to loop through the KeyValuePairs and retrieve the keynames. BUT, I also want to add each keyname as a member of a String array, so that I can assign that String array as the datasource for a comboBox.
Please let me know how I can do this without creating a counter outside of a For.. loop.
Thank you