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(); }
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(); }