Exemplo n.º 1
0
        private void Txt_LostFocus(object sender, EventArgs e)
        {
            SetWaterMark();
            if (_isSetWaterMark)
            {
                return;
            }
            var vt = VerifyManager.GetVerifyType(this);

            if (vt == null)
            {
                return;
            }
            var result = vt.Verify(this);

            if (result)
            {
                _hasError = false;
                HideToolTip();
                _changBorderColor = false;
                BorderColor       = _defaultBorderColor;
                _changBorderColor = true;
            }
            else
            {
                _changBorderColor = false;
                BorderColor       = Color.Red;
                _changBorderColor = true;
                _hasError         = true;
                ShowToolTip();
            }
            Invalidate();
        }
Exemplo n.º 2
0
 private void ZjxlText_TextChanged(object sender, EventArgs e)
 {
     //base.OnTextChanged(e);
     _changBorderColor = false;
     BorderColor       = _defaultBorderColor;
     _changBorderColor = true;
     if (!_isSetWaterMark)
     {
         var vt = VerifyManager.GetVerifyType(this);
         if (vt != null)
         {
             var result = vt.InputtingVerify(this);
             if (!result)
             {
                 Caption = _oldValue;
                 ZjxlText.SelectionStart = ZjxlText.Text.Length;
             }
         }
     }
     _oldValue = Caption;
     Invalidate();
     OnTextChanged();
 }