* 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;
@ -387,8 +388,11 @@ namespace Sunny.UI
} }
set set
{ {
Text = value.ToString("f" + decLength); if (Type == UITextBox.UIEditType.Double)
CheckMaxMin(); {
Text = value.ToString("f" + decLength);
CheckMaxMin();
}
} }
} }
@ -402,39 +406,14 @@ namespace Sunny.UI
} }
set set
{ {
Text = value.ToString(); if (Type == UITextBox.UIEditType.Integer)
CheckMaxMin(); {
Text = value.ToString();
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)
{ {
if (iDecimal == 0) if (iDecimal == 0)