I would like to know what code would take all Keys from a Hashtable and add them to a listbox. Thanks :D
Printable View
I would like to know what code would take all Keys from a Hashtable and add them to a listbox. Thanks :D
You could use the following instead, but it is preferable to use AddRange to add multiple items than multiple calls to Add:VB Code:
Dim myArray(myHasTable.Count - 1) As String myHashTable.Keys.CopyTo(myArray, 0) myListBox.Items.AddRange(myArray)VB Code:
For Each key As String In myHashTable.Keys myListBox.Items.Add(key) Next key
jmcilhinney, You are a genious :D Thanks.