diff --git a/KopLab1/FormLibrary/CustomListBox.cs b/KopLab1/FormLibrary/CustomListBox.cs index 35e7bd5..84a6cfc 100644 --- a/KopLab1/FormLibrary/CustomListBox.cs +++ b/KopLab1/FormLibrary/CustomListBox.cs @@ -45,15 +45,6 @@ namespace FormLibrary { SelectedItemChanged?.Invoke(this, EventArgs.Empty); } - public void PopulateListBox(ListBox listBox, List items) - { - listBox1.Items.Clear(); - - foreach (var item in items) - { - listBox.Items.Add(item); - } - } public void PopulateListBox(List items) { listBox1.Items.Clear(); diff --git a/KopLab1/FormLibrary/IntegerInputControl.cs b/KopLab1/FormLibrary/IntegerInputControl.cs index f721538..269c259 100644 --- a/KopLab1/FormLibrary/IntegerInputControl.cs +++ b/KopLab1/FormLibrary/IntegerInputControl.cs @@ -16,10 +16,8 @@ namespace FormLibrary { public partial class IntegerInputControl : UserControl { - // Событие, вызываемое при изменении значения в TextBox public event EventHandler? ValueChanged; - // Событие, вызываемое при изменении состояния CheckBox public event EventHandler? CheckBoxChanged; public IntegerInputControl() @@ -57,18 +55,11 @@ namespace FormLibrary } set { - if (value == null) + if(value is not null) { - checkBoxNull.Checked = true; - textBoxInput.Enabled = false; - textBoxInput.Text = string.Empty; - } - else - { - checkBoxNull.Checked = false; - textBoxInput.Enabled = true; textBoxInput.Text = value.ToString(); } + checkBoxNull.Checked = value is null; } } diff --git a/KopLab1/Forms/MainForm.cs b/KopLab1/Forms/MainForm.cs index 9f25190..fbc6896 100644 --- a/KopLab1/Forms/MainForm.cs +++ b/KopLab1/Forms/MainForm.cs @@ -100,7 +100,7 @@ namespace Forms { new Student { Group = "Пибд-33", FullName = "Иванов Иван Иванович", Course = 3 }, new Student { Group = "Пибд-33", FullName = "Петров Петр Петрович", Course = 2 }, - new Student { Group = "Пибд-33", FullName = "Сидоров Сидор Сидорович", Course = 1 } + new Student { Group = "Пибд-33", FullName = "Антонов Антон Антонович", Course = 1 } }; valueTableControl1.FillData(students);