From d1b72117058f1131046b6aa3add8e3ccfae033d8 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 09 十一月 2026 10:36:07 +0800
Subject: [PATCH] docs: CAN 模拟器独立 TCP 服务进程设计规格(统一 CanDeviceDriver + 双工推送协议)
---
HMI.UI/Controls/NumberInput.cs | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/HMI.UI/Controls/NumberInput.cs b/HMI.UI/Controls/NumberInput.cs
index d91c656..01d4234 100644
--- a/HMI.UI/Controls/NumberInput.cs
+++ b/HMI.UI/Controls/NumberInput.cs
@@ -37,7 +37,8 @@
{
// 鍏佽杈撳叆鏁板瓧銆佽礋鍙峰拰灏忔暟鐐�
Regex regex = new Regex(@"^-?\d*\.?\d*$");
- string newText = this.Text.Insert(this.CaretIndex, e.Text);
+ string segment = e.Text == "." ? ".0" : e.Text;
+ string newText = this.Text.Insert(this.CaretIndex, segment);
// 妫�鏌ユ槸鍚﹀凡缁忔湁璐熷彿锛屽鏋滄湁鍒欎笉鍏佽鍐嶈緭鍏ヨ礋鍙�
if (e.Text == "-" && this.Text.Contains("-"))
@@ -52,7 +53,10 @@
e.Handled = true;
return;
}
-
+ //else if (e.Text == ".") {
+ // e.Text = ".0";
+ //}
+ //regex = new Regex(@"^-?\d*\.?\d*$|^-?\.\d*$|^-?\d+\.$");
// 楠岃瘉瀹屾暣鐨勬柊鏂囨湰鏄惁绗﹀悎鏁板瓧鏍煎紡
if (!regex.IsMatch(newText))
{
--
Gitblit v1.9.1