提交当前本机整理版本

This commit is contained in:
cyf
2026-07-02 10:11:39 +00:00
parent c10a5d64c7
commit aacefa24f8
822 changed files with 196665 additions and 14263 deletions
+29 -1
View File
@@ -2228,4 +2228,32 @@ namespace Lskj.PubProductSmart
// 只允许输入一个负号
if ((e.KeyChar == '-') && ((sender as TextEdit).Text.IndexOf('-') > -1))
{
e.Handl
e.Handled = true;
}
// 只允许输入一个百分号
if ((e.KeyChar == '%') && ((sender as TextEdit).Text.IndexOf('%') > -1))
{
e.Handled = true;
}
}
/// <summary>
/// 限制數值框粘貼不能粘貼中文
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnIntEditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
{
string newText = e.NewValue as string;
// 第一个输入负号不会取消,出现了千位分隔符不会取消更改,末尾为百分号不会取消
if (!newText.Equals("-") && !string.IsNullOrEmpty(newText) && !Regex.IsMatch(newText, @"^(?:-(?:[0-9]+(?:,[0-9]{3})*(?:\.[0-9]*)?)|[0-9]+(?:,[0-9]{3})*(?:\.[0-9]*)?)(?:%)?$"))
{
e.Cancel = true; // 取消这次更改
}
}
}
}