Time validation in TextBox. Validating a textbox for some regular expression

前端 未结 3 794
北荒
北荒 2021-01-28 11:38

I\'ve to make a textbox(WPF) for entering time with validation. I want to enter a regular expression validation for time (6:12 am).

3条回答
  •  醉话见心
    2021-01-28 12:19

    check this: http://msdn.microsoft.com/en-us/library/system.windows.controls.validation.errors.aspx for handling validation errors in controls

    Else you can implement IDataErrorInfo in your viewmodel so that the Validation is embedded to your data itself.

提交回复
热议问题