diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index cf531e54..cf9dc29e 100644 Binary files a/Bin/net40/SunnyUI.Demo.exe and b/Bin/net40/SunnyUI.Demo.exe differ diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll index f1db8f74..12454406 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/SunnyUI/Controls/UIDoubleUpDown.cs b/SunnyUI/Controls/UIDoubleUpDown.cs index 04a77dcb..92c28b9f 100644 --- a/SunnyUI/Controls/UIDoubleUpDown.cs +++ b/SunnyUI/Controls/UIDoubleUpDown.cs @@ -123,9 +123,27 @@ namespace Sunny.UI } } - [DefaultValue(1)] + private int decLength = 1; + + [DefaultValue(1), Browsable(false)] [Description("小数位数"), Category("SunnyUI")] - public int Decimal { get; set; } = 1; + public int Decimal + { + get => decLength; + set + { + decLength = Math.Max(value, 0); + pnlValue.Text = _value.ToString("F" + decLength); + } + } + + [Description("显示文字小数位数"), Category("SunnyUI")] + [DefaultValue(1)] + public int DecimalPlaces + { + get => Decimal; + set => Decimal = value; + } private double step = 0.1; diff --git a/SunnyUI/Controls/UITextBox.cs b/SunnyUI/Controls/UITextBox.cs index 466921fe..7b12c9fb 100644 --- a/SunnyUI/Controls/UITextBox.cs +++ b/SunnyUI/Controls/UITextBox.cs @@ -707,12 +707,21 @@ namespace Sunny.UI /// [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; + } + [DefaultValue(false)] [Description("整形或浮点输入时,是否可空显示"), Category("SunnyUI")] public bool CanEmpty