* 修改部分控件小数位数属性名称为DecimalPlaces

This commit is contained in:
Sunny 2022-01-28 17:49:45 +08:00
parent 79500d1797
commit e63472dc5f
4 changed files with 29 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -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;

View File

@ -707,12 +707,21 @@ namespace Sunny.UI
/// </summary>
[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