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) {