I'm sure this question can apply to both, although I'm usually working with VB6 code, but why use Lost Focus vs Validate? As an example, say I need a date entered in a text box for date of birth, i want to make sure that date is entered in mm/dd/yyyy format, why would I choose to go with Validate vs Lost Focus?
2
votes
1 Answers
3
votes
Lost focus only fires when the user moves focus from that control to another one. The validated event fires at the point of validation. More info on validation here: WinForm UI Validation
Note that you should use a datetimepicker for date entry; that way you do not have to worry amount the format entered as it's value
property is a date
DateTimePicker
there is no reason to be so restrictive.DateTime
can parse can parse from any legal format for a culture. – Ňɏssa Pøngjǣrdenlarp