diff --git a/SunnyUI/Controls/UIDoubleUpDown.cs b/SunnyUI/Controls/UIDoubleUpDown.cs
index db8d00f1..39a13a64 100644
--- a/SunnyUI/Controls/UIDoubleUpDown.cs
+++ b/SunnyUI/Controls/UIDoubleUpDown.cs
@@ -133,16 +133,16 @@ namespace Sunny.UI
{
value = CheckMaxMin(value);
_value = value;
- pnlValue.Text = _value.ToString("F" + Decimal);
+ pnlValue.Text = _value.ToString("F" + decLength);
ValueChanged?.Invoke(this, _value);
}
}
private int decLength = 1;
- [DefaultValue(1), Browsable(false)]
- [Description("小数位数"), Category("SunnyUI")]
- public int Decimal
+ [Description("显示文字小数位数"), Category("SunnyUI")]
+ [DefaultValue(1)]
+ public int DecimalPlaces
{
get => decLength;
set
@@ -152,14 +152,6 @@ namespace Sunny.UI
}
}
- [Description("显示文字小数位数"), Category("SunnyUI")]
- [DefaultValue(1)]
- public int DecimalPlaces
- {
- get => Decimal;
- set => Decimal = value;
- }
-
private double step = 0.1;
[DefaultValue(0.1)]
@@ -314,7 +306,7 @@ namespace Sunny.UI
pnlColor = pnlValue.FillColor;
pnlValue.FillColor = Color.White;
edit.TextAlign = HorizontalAlignment.Center;
- edit.DecLength = Decimal;
+ edit.DecLength = decLength;
edit.DoubleValue = Value;
edit.BringToFront();
edit.Visible = true;
diff --git a/SunnyUI/Controls/UIProcessBar.cs b/SunnyUI/Controls/UIProcessBar.cs
index c14b26a3..e1d3f52f 100644
--- a/SunnyUI/Controls/UIProcessBar.cs
+++ b/SunnyUI/Controls/UIProcessBar.cs
@@ -227,15 +227,6 @@ namespace Sunny.UI
private int decimalCount = 1;
- [Description("显示文字小数位数"), Category("SunnyUI")]
- [DefaultValue(1), Browsable(false)]
- [Obsolete("请用DecimalPlaces代替。")]
- public int DecimalCount
- {
- get => decimalCount;
- set => decimalCount = Math.Max(value, 0);
- }
-
///
/// 设置主题样式
///
diff --git a/SunnyUI/Controls/UITextBox.cs b/SunnyUI/Controls/UITextBox.cs
index 9a61e537..5dc91ea0 100644
--- a/SunnyUI/Controls/UITextBox.cs
+++ b/SunnyUI/Controls/UITextBox.cs
@@ -754,24 +754,12 @@ namespace Sunny.UI
set => edit.Text = value;
}
- ///
- /// 当InputType为数字类型时,小数位数。
- ///
- [Description("当InputType为数字类型时,小数位数。")]
- [DefaultValue(2), Category("SunnyUI")]
- [Browsable(false)]
- public int DecLength
- {
- get => edit.DecLength;
- set => edit.DecLength = Math.Max(value, 0);
- }
-
[Description("浮点数,显示文字小数位数"), Category("SunnyUI")]
[DefaultValue(2)]
public int DecimalPlaces
{
- get => DecLength;
- set => DecLength = value;
+ get => edit.DecLength;
+ set => edit.DecLength = Math.Max(value, 0);
}
[DefaultValue(false)]
diff --git a/SunnyUI/Forms/UIFormHelper.cs b/SunnyUI/Forms/UIFormHelper.cs
index 99dcd3d4..aed90033 100644
--- a/SunnyUI/Forms/UIFormHelper.cs
+++ b/SunnyUI/Forms/UIFormHelper.cs
@@ -444,7 +444,7 @@ namespace Sunny.UI
frm.TopMost = topMost;
frm.Style = style;
frm.Editor.Type = UITextBox.UIEditType.Double;
- frm.Editor.DecLength = decimals;
+ frm.Editor.DecimalPlaces = decimals;
frm.Editor.DoubleValue = value;
frm.Text = UILocalize.InputTitle;
frm.Label.Text = desc;
@@ -469,7 +469,7 @@ namespace Sunny.UI
frm.TopMost = topMost;
frm.Style = style;
frm.Editor.Type = UITextBox.UIEditType.Double;
- frm.Editor.DecLength = decimals;
+ frm.Editor.DecimalPlaces = decimals;
frm.Editor.DoubleValue = value;
frm.Text = UILocalize.InputTitle;
frm.Label.Text = desc;