From 23532fa8ad34c89b6d24b01eaef6475fd0aad898 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 15 四月 2020 18:08:24 +0800
Subject: [PATCH] ???????

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs
index 6b26088..3c44056 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs
@@ -20,9 +20,13 @@
         /// </summary>
         public Action<string> FinishInputEvent = null;
         /// <summary>
-        /// 瀵嗙爜杈撳叆绫诲瀷
+        /// 瀵嗙爜杈撳叆绫诲瀷(瀹冧笌NumberInputOnly涓嶅叡瀛�)
         /// </summary>
         public bool SecureTextEntry = false;
+        /// <summary>
+        /// 杈撳叆閿洏鎸囧畾涓烘暟瀛楅敭鐩�(榛樿涓簍rue,瀹冧笌SecureTextEntry涓嶅叡瀛�)
+        /// </summary>
+        public bool NumberInputOnly = true;
         /// <summary>
         /// 楠岃瘉鐮侀暱搴�
         /// </summary>
@@ -64,7 +68,7 @@
                 frameCode.X = i * Application.GetRealWidth(115 + 49);
                 frameCode.Width = Application.GetRealWidth(115);
                 frameCode.Height = Application.GetRealHeight(104);
-                frameCode.Radius = 6;
+                frameCode.Radius = (uint)Application.GetRealHeight(17);
                 frameCode.BorderWidth = 1;
                 frameCode.BorderColor = UserCenterColor.Current.TextFrameColor;
                 this.AddChidren(frameCode);
@@ -73,6 +77,10 @@
                 if (SecureTextEntry == true)
                 {
                     txtCode.SecureTextEntry = true;
+                }
+                else if (NumberInputOnly == true)
+                {
+                    txtCode.IsNumberKeyboardType = true;
                 }
                 txtCode.Name = i.ToString();
                 txtCode.TextAlignment = TextAlignment.Center;
@@ -84,6 +92,8 @@
                 txtCode.FoucsChanged += this.TxtCode_FoucsChangedEvent;
                 //鍊兼敼鍙樹簨浠�
                 txtCode.TextChangeEventHandler += this.TxtCode_TextChangeEvent;
+                //閿洏浜嬩欢
+                txtCode.KeyEventAction += this.TxtCode_KeyEvent;
             }
         }
 
@@ -172,6 +182,26 @@
             }
         }
 
+        /// <summary>
+        /// 閿洏浜嬩欢
+        /// </summary>
+        /// <param name="keysCode"></param>
+        private void TxtCode_KeyEvent(object sender, string keysCode)
+        {
+            if (keysCode == "Del")
+            {
+                var txtCode = (TextInputControl)sender;
+                if (txtCode.Text == string.Empty)
+                {
+                    int index = Convert.ToInt32(txtCode.Name);
+                    if (dicCodeControls.ContainsKey(index - 1) == true)
+                    {
+                        dicCodeControls[index - 1].Foucs = true;
+                    }
+                }
+            }
+        }
+
         #endregion
 
         #region 鈻� 涓�鑸柟娉昣__________________________

--
Gitblit v1.8.0