This commit is contained in:
Алексей Тихоненков 2024-09-05 15:25:41 +04:00
parent 079f196dcf
commit 4794158d40
2 changed files with 14 additions and 21 deletions

View File

@ -34,18 +34,16 @@ namespace WinFormsLibrary1
{ {
get get
{ {
string checkedItems = "";
for (int i = 0; i < checkedListBox.Items.Count; i++) if (checkedListBox.SelectedItem != null)
{ {
if (checkedListBox.GetItemChecked(i)) return checkedListBox.SelectedItem.ToString();
{
checkedItems += checkedListBox.Items[i].ToString() + " ";
} }
}
if (checkedListBox.CheckedItems != null)
return checkedItems;
else else
{
return ""; return "";
}
} }
set set
{ {

View File

@ -53,17 +53,12 @@ namespace COP
set set
{ {
if (!minValue.HasValue || !maxValue.HasValue) if (!minValue.HasValue || !maxValue.HasValue || value < minValue || value > maxValue)
{ {
throw new NoRangeException("Диапозон не был задан");
}
if (value < minValue || value > maxValue)
{
return; return;
} }
dateTimePicker.Value = value.Value; dateTimePicker.Value = value.Value;
} }