галка пустого значения накладывалась на элемент вывода
This commit is contained in:
parent
a5ac4947d0
commit
1f4ee6b285
@ -20,6 +20,9 @@ namespace DesktopTools.BaseControls
|
||||
InitializeComponent();
|
||||
_baseControl = this;
|
||||
|
||||
checkBox.CheckedChanged += (object sender, EventArgs e) => { CallOnValueChangeEvent(); };
|
||||
panelControl.Controls.Add(checkBox);
|
||||
|
||||
if (!_mustFilling)
|
||||
{
|
||||
checkBoxNullable.CheckedChanged += (object sender, EventArgs e) =>
|
||||
@ -29,9 +32,6 @@ namespace DesktopTools.BaseControls
|
||||
};
|
||||
panelControl.Controls.Add(checkBoxNullable);
|
||||
}
|
||||
|
||||
checkBox.CheckedChanged += (object sender, EventArgs e) => { CallOnValueChangeEvent(); };
|
||||
panelControl.Controls.Add(checkBox);
|
||||
}
|
||||
|
||||
public void SetDefaultValue() => _originalValue = _mustFilling ? false : null;
|
||||
|
@ -24,16 +24,6 @@ namespace DesktopTools.BaseControls
|
||||
InitializeComponent();
|
||||
_baseControl = this;
|
||||
|
||||
if (!_mustFilling)
|
||||
{
|
||||
checkBoxNullable.CheckedChanged += (object sender, EventArgs e) =>
|
||||
{
|
||||
dateTimePicker.Enabled = !(sender as CheckBox).Checked;
|
||||
CallOnValueChangeEvent();
|
||||
};
|
||||
panelControl.Controls.Add(checkBoxNullable);
|
||||
}
|
||||
|
||||
dateTimePicker.ValueChanged += (object sender, EventArgs e) => { CallOnValueChangeEvent(); };
|
||||
if (minDate > DateTime.MinValue)
|
||||
{
|
||||
@ -48,6 +38,16 @@ namespace DesktopTools.BaseControls
|
||||
dateTimePicker.CustomFormat = customDateFormat;
|
||||
}
|
||||
panelControl.Controls.Add(dateTimePicker);
|
||||
|
||||
if (!_mustFilling)
|
||||
{
|
||||
checkBoxNullable.CheckedChanged += (object sender, EventArgs e) =>
|
||||
{
|
||||
dateTimePicker.Enabled = !(sender as CheckBox).Checked;
|
||||
CallOnValueChangeEvent();
|
||||
};
|
||||
panelControl.Controls.Add(checkBoxNullable);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDefaultValue() => _originalValue = _mustFilling ? DateTime.Now : null;
|
||||
|
@ -23,16 +23,6 @@ namespace DesktopTools.BaseControls
|
||||
InitializeComponent();
|
||||
_baseControl = this;
|
||||
|
||||
if (!_mustFilling)
|
||||
{
|
||||
checkBoxNullable.CheckedChanged += (object sender, EventArgs e) =>
|
||||
{
|
||||
numericUpDown.Enabled = !(sender as CheckBox).Checked;
|
||||
CallOnValueChangeEvent();
|
||||
};
|
||||
panelControl.Controls.Add(checkBoxNullable);
|
||||
}
|
||||
|
||||
numericUpDown.ValueChanged += (object sender, EventArgs e) => { CallOnValueChangeEvent(); };
|
||||
if (minValue != 0)
|
||||
{
|
||||
@ -47,6 +37,16 @@ namespace DesktopTools.BaseControls
|
||||
numericUpDown.DecimalPlaces = decimalPlaces;
|
||||
}
|
||||
panelControl.Controls.Add(numericUpDown);
|
||||
|
||||
if (!_mustFilling)
|
||||
{
|
||||
checkBoxNullable.CheckedChanged += (object sender, EventArgs e) =>
|
||||
{
|
||||
numericUpDown.Enabled = !(sender as CheckBox).Checked;
|
||||
CallOnValueChangeEvent();
|
||||
};
|
||||
panelControl.Controls.Add(checkBoxNullable);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDefaultValue() => _originalValue = _mustFilling ? 0 : null;
|
||||
|
@ -22,15 +22,6 @@ namespace DesktopTools.BaseControls
|
||||
InitializeComponent();
|
||||
_baseControl = this;
|
||||
|
||||
if (!_mustFilling)
|
||||
{
|
||||
checkBoxNullable.CheckedChanged += (object sender, EventArgs e) =>
|
||||
{
|
||||
comboBox.Enabled = !(sender as CheckBox).Checked;
|
||||
CallOnValueChangeEvent();
|
||||
};
|
||||
panelControl.Controls.Add(checkBoxNullable);
|
||||
}
|
||||
if (enumType.Name.StartsWith("Nullable"))
|
||||
{
|
||||
enumType = Nullable.GetUnderlyingType(enumType);
|
||||
@ -43,6 +34,16 @@ namespace DesktopTools.BaseControls
|
||||
}
|
||||
comboBox.SelectedIndexChanged += (object sender, EventArgs e) => { CallOnValueChangeEvent(); };
|
||||
panelControl.Controls.Add(comboBox);
|
||||
|
||||
if (!_mustFilling)
|
||||
{
|
||||
checkBoxNullable.CheckedChanged += (object sender, EventArgs e) =>
|
||||
{
|
||||
comboBox.Enabled = !(sender as CheckBox).Checked;
|
||||
CallOnValueChangeEvent();
|
||||
};
|
||||
panelControl.Controls.Add(checkBoxNullable);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDefaultValue() => _originalValue = null;
|
||||
|
@ -22,16 +22,6 @@ namespace DesktopTools.BaseControls
|
||||
InitializeComponent();
|
||||
_baseControl = this;
|
||||
|
||||
if (!_mustFilling)
|
||||
{
|
||||
checkBoxNullable.CheckedChanged += (object sender, EventArgs e) =>
|
||||
{
|
||||
numericUpDown.Enabled = !(sender as CheckBox).Checked;
|
||||
CallOnValueChangeEvent();
|
||||
};
|
||||
panelControl.Controls.Add(checkBoxNullable);
|
||||
}
|
||||
|
||||
numericUpDown.ValueChanged += (object sender, EventArgs e) => { CallOnValueChangeEvent(); };
|
||||
if (minValue != 0)
|
||||
{
|
||||
@ -42,6 +32,16 @@ namespace DesktopTools.BaseControls
|
||||
numericUpDown.Maximum = maxValue;
|
||||
}
|
||||
panelControl.Controls.Add(numericUpDown);
|
||||
|
||||
if (!_mustFilling)
|
||||
{
|
||||
checkBoxNullable.CheckedChanged += (object sender, EventArgs e) =>
|
||||
{
|
||||
numericUpDown.Enabled = !(sender as CheckBox).Checked;
|
||||
CallOnValueChangeEvent();
|
||||
};
|
||||
panelControl.Controls.Add(checkBoxNullable);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDefaultValue() => _originalValue = _mustFilling ? 0 : null;
|
||||
|
Loading…
Reference in New Issue
Block a user