开发者

Validation Error in Wpf

How to check whether the text box has validation errrors in .cs file. I have attached validation rule开发者_StackOverflow社区 for the textbox and i display the error message in the UI. Would i be able to check whether a textBox has validation error.

Edited :

I found the answer :

Validation.GetHasError(<textbox instance>)


Validation.HasError attached property is there

http://msdn.microsoft.com/en-us/library/system.windows.controls.validation.haserror.aspx

bool hasError = Validation.GetHasError(txtAttributeName)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜