From b5b1e8b5a486f926fe456e99c704a818b35fb463 Mon Sep 17 00:00:00 2001 From: Sunny Date: Sun, 26 Mar 2023 22:57:35 +0800 Subject: [PATCH] =?UTF-8?q?*=20UINumPadTextBox:=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E6=9C=80=E5=A4=A7=E5=80=BC=E3=80=81=E6=9C=80=E5=B0=8F?= =?UTF-8?q?=E5=80=BC=E7=AD=89=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/DropItem/UIDropControl.cs | 8 ++++++ SunnyUI/Controls/UINumPadTextBox.cs | 31 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/SunnyUI/Controls/DropItem/UIDropControl.cs b/SunnyUI/Controls/DropItem/UIDropControl.cs index 519fd20f..92f81085 100644 --- a/SunnyUI/Controls/DropItem/UIDropControl.cs +++ b/SunnyUI/Controls/DropItem/UIDropControl.cs @@ -74,6 +74,14 @@ namespace Sunny.UI ControlBoxRect = new Rectangle(Width - 24, 0, 24, Height); } + [Description("开启后可响应某些触屏的点击事件"), Category("SunnyUI")] + [DefaultValue(false)] + public bool TouchPressClick + { + get => edit.TouchPressClick; + set => edit.TouchPressClick = value; + } + private UIButton tipsBtn; public void SetTipsText(ToolTip toolTip, string text) { diff --git a/SunnyUI/Controls/UINumPadTextBox.cs b/SunnyUI/Controls/UINumPadTextBox.cs index e9d968a7..1f67edc3 100644 --- a/SunnyUI/Controls/UINumPadTextBox.cs +++ b/SunnyUI/Controls/UINumPadTextBox.cs @@ -18,6 +18,7 @@ * * 2023-03-18: V3.3.3 增加文件说明 * 2023-03-26: V3.3.3 增加默认事件ValueChanged,下键盘Enter事件相应此事件 + * 2023-03-26: V3.3.4 增加了最大值、最小值等属性 ******************************************************************************/ using System; @@ -268,5 +269,35 @@ namespace Sunny.UI if (NumPadForm != null && NumPadForm.Visible) NumPadForm.Close(); } + + /// + /// 当InputType为数字类型时,能输入的最大值 + /// + [Description("当InputType为数字类型时,能输入的最大值。"), Category("SunnyUI")] + [DefaultValue(2147483647D)] + public double Maximum + { + get => edit.MaxValue; + set => edit.MaxValue = value; + } + + /// + /// 当InputType为数字类型时,能输入的最小值 + /// + [Description("当InputType为数字类型时,能输入的最小值。"), Category("SunnyUI")] + [DefaultValue(-2147483648D)] + public double Minimum + { + get => edit.MinValue; + set => edit.MinValue = value; + } + + [Description("浮点数,显示文字小数位数"), Category("SunnyUI")] + [DefaultValue(2)] + public int DecimalPlaces + { + get => edit.DecLength; + set => edit.DecLength = Math.Max(value, 0); + } } }