From 50583beb33c9e7710f797b8174f2c6a8573fa59a Mon Sep 17 00:00:00 2001 From: platoff aeeee Date: Tue, 1 Oct 2024 10:21:43 +0400 Subject: [PATCH] lab done --- Library15Gerimovich/DefaultList.cs | 62 +------------------------- Library15Gerimovich/InputRealNumber.cs | 6 ++- 2 files changed, 5 insertions(+), 63 deletions(-) diff --git a/Library15Gerimovich/DefaultList.cs b/Library15Gerimovich/DefaultList.cs index c63cc94..1777138 100644 --- a/Library15Gerimovich/DefaultList.cs +++ b/Library15Gerimovich/DefaultList.cs @@ -19,7 +19,7 @@ namespace Library15Gerimovich InitializeComponent(); } - // метод, передающий строку + // метод, передающий строку в список public void SetItems(string Items) { MainListBox.Items.Add(Items); @@ -49,63 +49,3 @@ namespace Library15Gerimovich } } } - - - - - -// метод, передающий строку -//public void SetItems(string Items) -//{ - -// string[] itemArray = Items.Split(','); // разбиваем по запятым - -// MainListBox.Items.Clear(); - -// foreach (var item in itemArray) -// { -// MainListBox.Items.Add(item.Trim()); // Trim для удаления пробелов -// } -//} - -//public event EventHandler? SelectedValueChanged; - -//public string SelectedValue -//{ -// get -// { -// return checkedListBox1.SelectedItem?.ToString() ?? string.Empty; -// } -// set -// { -// int index = checkedListBox1.Items.IndexOf(value); -// if (index >= 0) -// { -// checkedListBox1.SelectedIndex = index; -// } -// else -// { -// checkedListBox1.ClearSelected(); -// } -// } -//} - -//public DefaultList() -//{ -// InitializeComponent(); -//} - -//public void AddItemToList(string item) -//{ -// ListBox.Items.Add(item); -//} - -//private void SelectedIndexChanged(object sender, EventArgs e) -//{ -// SelectedValueChanged?.Invoke(this, e); -//} - -//public void ClearComboBox() -//{ -// checkedListBox1.Items.Clear(); -//} diff --git a/Library15Gerimovich/InputRealNumber.cs b/Library15Gerimovich/InputRealNumber.cs index 7d9e13d..9655dec 100644 --- a/Library15Gerimovich/InputRealNumber.cs +++ b/Library15Gerimovich/InputRealNumber.cs @@ -19,7 +19,8 @@ namespace Library15Gerimovich { InitializeComponent(); } - + + // вещественное число public double? DoubleValue { get @@ -60,6 +61,7 @@ namespace Library15Gerimovich remove { _valueChanged -= value; } } + // проверяем нажата ли кнопка is null private void SetNullState(bool IsNull, bool ClearText = false) { IsNullCheckBox.Checked = IsNull; @@ -70,7 +72,7 @@ namespace Library15Gerimovich MainTextBox.Text = string.Empty; } } - + // проверяем нажата ли кнопка is null private void IsNullCheckBox_CheckedChanged(object sender, EventArgs e) { SetNullState(IsNullCheckBox.Checked);