From d76b0e40e5bb127fd33aa1f7842447a1df0628d5 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期日, 30 七月 2023 22:16:34 +0800 Subject: [PATCH] Update PublicAssmeblyBLL.cs --- HDL_ON/UI/UI0-Public/PublicAssmebly.cs | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs index fd6cc65..e274951 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs @@ -11,12 +11,16 @@ { public partial class PublicAssmebly { + public Button btnTip; + + public int entryMaxLength = 20; + //public Action entrylistener; void EditParaterEvent(Button btnConfirm, int errorId_IsNullOrEmpty, int errorId_ContainsPar, List<string> list, EditText editText, Action<string> callBackAction, FrameLayout contentView, Button btnLine, Button btnCancel, FrameLayout editView, Dialog dialog, int titleId) { - var btnTip = new Button() + btnTip = new Button() { X = editView.X, Y = editView.Bottom, @@ -151,13 +155,14 @@ etParater.TextChangeEventHandler = (sender, e) => { - if (etParater.Text.Length > 20) + if (System.Text.Encoding.UTF8.GetBytes(etParater.Text).Length > entryMaxLength) { - etParater.Text = etParater.Text.Remove(20); + etParater.Text = etParater.Text.Remove(etParater.Text.Length-1); #if __ANDROID__ etParater.SetSelectionEnd(); #endif + //entrylistener?.Invoke(); } }; -- Gitblit v1.8.0