diff --git a/AirBomber/AirBomber/FormPlaneCollection.Designer.cs b/AirBomber/AirBomber/FormPlaneCollection.Designer.cs index 9f69ef5..b670071 100644 --- a/AirBomber/AirBomber/FormPlaneCollection.Designer.cs +++ b/AirBomber/AirBomber/FormPlaneCollection.Designer.cs @@ -155,6 +155,7 @@ listBoxStorages.Name = "listBoxStorages"; listBoxStorages.Size = new Size(281, 129); listBoxStorages.TabIndex = 0; + listBoxStorages.SelectedIndexChanged += listBoxStorages_SelectedIndexChanged; // // FormPlaneCollection // diff --git a/AirBomber/AirBomber/FormPlaneCollection.cs b/AirBomber/AirBomber/FormPlaneCollection.cs index 8646a07..49ce1c9 100644 --- a/AirBomber/AirBomber/FormPlaneCollection.cs +++ b/AirBomber/AirBomber/FormPlaneCollection.cs @@ -26,7 +26,9 @@ namespace AirBomber /// private void ReloadObjects() { - int index = listBoxStorages.SelectedIndex; listBoxStorages.Items.Clear(); + int index = listBoxStorages.SelectedIndex; + + listBoxStorages.Items.Clear(); for (int i = 0; i < _storage.Keys.Count; i++) { listBoxStorages.Items.Add(_storage.Keys[i]); @@ -45,11 +47,10 @@ namespace AirBomber /// /// /// - private void listBoxObjects_SelectedIndexChanged(object sender, EventArgs e) + private void listBoxStorages_SelectedIndexChanged(object sender, EventArgs e) { pictureBoxCollection.Image = _storage[listBoxStorages.SelectedItem?.ToString()?? string.Empty]?.ShowPlanes(); } - /// /// Добавление объекта в набор ///