Петрушин Егор ПИбд-22 Лабораторная работа №4 "Самоходная артиллерийская установка" #9

Closed
Egor_Petrushin wants to merge 5 commits from PIbd-22_Petrushin_E.A._Lab4 into PIbd-22_Petrushin_E.A._Lab3
3 changed files with 15 additions and 5 deletions
Showing only changes of commit 854c7ea1b6 - Show all commits

View File

@ -115,11 +115,11 @@
//
listBoxStorages.FormattingEnabled = true;
listBoxStorages.ItemHeight = 20;
listBoxStorages.Items.AddRange(new object[] { "Ans", "Second", "Dry", "Quadro" });
listBoxStorages.Location = new Point(18, 87);
listBoxStorages.Name = "listBoxStorages";
listBoxStorages.Size = new Size(143, 64);
listBoxStorages.TabIndex = 7;
listBoxStorages.SelectedIndexChanged += listBoxStorages_SelectedIndexChanged;
//
// ButtonDelObject
//

View File

@ -62,12 +62,12 @@ namespace SelfPropelledArtilleryUnit
/// <param name="e"></param>
private void ButtonAddObject_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(listBoxStorages.Text))
if (string.IsNullOrEmpty(textBoxStorageName.Text))
{
MessageBox.Show("Не все данные заполнены", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
_storage.AddSet(listBoxStorages.Text);
_storage.AddSet(textBoxStorageName.Text);
ReloadObjects();
}
@ -76,10 +76,16 @@ namespace SelfPropelledArtilleryUnit
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ListBoxObjects_SelectedIndexChanged(object sender, EventArgs e)
private void listBoxStorages_SelectedIndexChanged(object sender, EventArgs e)
{
pictureBoxCollection.Image = _storage[listBoxStorages.SelectedItem?.ToString() ?? string.Empty]?.ShowSPAUs();
}
/// <summary>
/// Удаление набора
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonDelObject_Click(object sender, EventArgs e)
{
@ -188,5 +194,7 @@ namespace SelfPropelledArtilleryUnit
}
pictureBoxCollection.Image = obj.ShowSPAUs();
}
}
}

View File

@ -1,4 +1,6 @@
using System;
using SelfPropelledArtilleryUnit.DrawningObjects;
using SelfPropelledArtilleryUnit.MovementStrategy;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;