I just saw this behaviour and I\'m a bit surprised by it...
If I add 3 or 4 elements to a Dictionary, and then do a \"For Each\" to get all the keys, they appear in
A dictionary retrieves items in hashed order. The fact that they came out in insertion order was a total coincidence.
The MSDN documentation says:
The order of the keys in the KeyCollection is unspecified, but it is the same order as the associated values in the ValueCollection returned by the Values property.