* UIEdit: 修复了一个最小值大于0是,显示类型为字符串Text为空仍有显示的问题

This commit is contained in:
Sunny 2022-12-18 22:06:05 +08:00
parent c1df84826e
commit 354a30dcb7

View File

@ -17,6 +17,7 @@
* : 2020-01-01 * : 2020-01-01
* *
* 2020-01-01: V2.2.0 * 2020-01-01: V2.2.0
* 2022-12-18: V3.3.0 0Text为空仍有显示的问题
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -386,11 +387,14 @@ namespace Sunny.UI
return Text.ToDouble(); return Text.ToDouble();
} }
set set
{
if (Type == UITextBox.UIEditType.Double)
{ {
Text = value.ToString("f" + decLength); Text = value.ToString("f" + decLength);
CheckMaxMin(); CheckMaxMin();
} }
} }
}
[DefaultValue(0)] [DefaultValue(0)]
public int IntValue public int IntValue
@ -401,39 +405,14 @@ namespace Sunny.UI
return Text.ToInt(); return Text.ToInt();
} }
set set
{
if (Type == UITextBox.UIEditType.Integer)
{ {
Text = value.ToString(); Text = value.ToString();
CheckMaxMin(); CheckMaxMin();
} }
} }
}
//[DefaultValue(int.MaxValue)]
//public double MaxValue
//{
// get => maxValue;
// set
// {
// maxValue = value;
// if (maxValue < minValue)
// minValue = maxValue;
// CheckMaxMin();
// Invalidate();
// }
//}
//
//[DefaultValue(int.MinValue)]
//public double MinValue
//{
// get => minValue;
// set
// {
// minValue = value;
// if (minValue > maxValue)
// maxValue = minValue;
// CheckMaxMin();
// Invalidate();
// }
//}
private string DecimalToMask(int iDecimal) private string DecimalToMask(int iDecimal)
{ {