From 4e7e01499fcdd57a6d4b04731b82052148260f0c Mon Sep 17 00:00:00 2001 From: DyCTaTOR <125912249+DyCTaTOR@users.noreply.github.com> Date: Wed, 8 Nov 2023 09:01:20 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Monorail/Monorail/FormMonorailCollection.Designer.cs | 1 + Monorail/Monorail/FormMonorailCollection.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Monorail/Monorail/FormMonorailCollection.Designer.cs b/Monorail/Monorail/FormMonorailCollection.Designer.cs index a1b15a0..e8e5af4 100644 --- a/Monorail/Monorail/FormMonorailCollection.Designer.cs +++ b/Monorail/Monorail/FormMonorailCollection.Designer.cs @@ -97,6 +97,7 @@ listBoxStorages.Name = "listBoxStorages"; listBoxStorages.Size = new Size(144, 104); listBoxStorages.TabIndex = 9; + listBoxStorages.Click += ListBoxObjects_SelectedIndexChanged; // // textBoxStorageName // diff --git a/Monorail/Monorail/FormMonorailCollection.cs b/Monorail/Monorail/FormMonorailCollection.cs index 39dd360..6a267a2 100644 --- a/Monorail/Monorail/FormMonorailCollection.cs +++ b/Monorail/Monorail/FormMonorailCollection.cs @@ -42,6 +42,12 @@ namespace Monorail { listBoxStorages.SelectedIndex = index; } + var obj = _storage[listBoxStorages.SelectedItem.ToString() ?? string.Empty]; + if (obj == null) + { + return; + } + pictureBoxCollection.Image = obj.ShowMonorails(); } private void ButtonAddObject_Click(object sender, EventArgs e) {