Финал

This commit is contained in:
GokaPek 2023-10-25 10:01:29 +04:00
parent 981cccdaa5
commit 854c7ea1b6
3 changed files with 15 additions and 5 deletions

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;