diff --git a/ContainerShip/ContainerShip/FormMapWithSetShips.cs b/ContainerShip/ContainerShip/FormMapWithSetShips.cs index 52785df..42c141b 100644 --- a/ContainerShip/ContainerShip/FormMapWithSetShips.cs +++ b/ContainerShip/ContainerShip/FormMapWithSetShips.cs @@ -46,9 +46,9 @@ namespace ContainerShip int index = listBoxMaps.SelectedIndex; listBoxMaps.Items.Clear(); - foreach (string key in _mapsCollection.Keys) + for (int i = 0; i < _mapsCollection.Keys.Count; i++) { - listBoxMaps.Items.Add(key); + listBoxMaps.Items.Add(_mapsCollection.Keys[i]); } if (listBoxMaps.Items.Count > 0 && (index == -1 || index >= listBoxMaps.Items.Count))