| | |
| | | /// <summary>
|
| | | /// 验证码控件
|
| | | /// </summary>
|
| | | public class VerificationCodeControl : FrameLayout
|
| | | public class VerificationCodeControl : NormalFrameLayout
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | |
| | | }
|
| | | if (e.Focus == true)
|
| | | {
|
| | | //自动焦点选择前面的空白位置
|
| | | //if (txtCode.Text == string.Empty)
|
| | | //{
|
| | | // for (int i = 0; i < this.CodeLenth; i++)
|
| | | // {
|
| | | // if (dicCodeControls[i].Text == string.Empty)
|
| | | // {
|
| | | // dicCodeControls[i].FoucsChanged -= this.TxtCode_FoucsChangedEvent;
|
| | | // dicCodeControls[i].Parent.BorderColor = UserCenterColor.Current.TextFrameSelectColor;
|
| | | // dicCodeControls[i].Foucs = true;
|
| | | // dicCodeControls[i].FoucsChanged += this.TxtCode_FoucsChangedEvent;
|
| | | // return;
|
| | | // }
|
| | | // }
|
| | | //}
|
| | | txtCode.Parent.BorderColor = UserCenterColor.Current.TextFrameSelectColor;
|
| | | }
|
| | | else
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 清空输入的值
|
| | | /// </summary>
|
| | | public void ClearInputValue()
|
| | | {
|
| | | foreach (var inputText in this.dicCodeControls.Values)
|
| | | {
|
| | | //先移除事件
|
| | | inputText.TextChangeEventHandler -= TxtCode_TextChangeEvent;
|
| | | //赋值
|
| | | inputText.Text = string.Empty;
|
| | | inputText.TextChangeEventHandler += TxtCode_TextChangeEvent;
|
| | | }
|
| | | dicCodeControls[0].Foucs = true;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 控件摧毁___________________________
|