开发者

Date validation in WPF

开发者 https://www.devze.com 2023-01-17 17:53 出处:网络
I want to validate the date entered in the format dd/mm/yyyy. Using exceptio开发者_运维百科nvalidation I can validate correctly only if the date is entered in the format mm/dd/yyyy. Can anyone suggest

I want to validate the date entered in the format dd/mm/yyyy. Using exceptio开发者_运维百科nvalidation I can validate correctly only if the date is entered in the format mm/dd/yyyy. Can anyone suggest some workarounds?


try doing two validations, i assume you are validating a string using DateTime.Parse.

On the second validation try specifying a culture which uses ddmmyyyy format, such as Australia

0

精彩评论

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