I don't now how to validate date time picker controls....someone know?
huskarit 0 Light Poster
Recommended Answers
Jump to PostWhat do you have to validate in dateTimepicker control? There is always a datetime selected (and shown). There cannot occur any error.
Explain what do you want to validate.If you will use Value property of selected date, you will always get certain and real datetime value.
Jump to Post1. dateTimePicker1.MinDate = DateTime.Today 2. dateTimePicker1.MinDate = new DateTime(2012, 2, 3) 'your departure date 3. 'dont know what it means
Anwyay, you see how you can set youur datetimepicker (use MinDate or MaxDate, to determine lower and upper date).
Jump to Postyou can simply do this like this
'Can only accept future dates(from today to the future, not the past) if datetimepicker.value.date >= now.date() then ' if true then code here else 'if false then here end if 'Can only be AFTER departure date if datetimepicker.value.date > departuredate …
All 9 Replies

CriticalError
Mitja Bonca 557 Nearly a Posting Maven
huskarit 0 Light Poster
Mitja Bonca 557 Nearly a Posting Maven
M.Waqas Aslam 67 Posting Pro in Training Featured Poster
huskarit 0 Light Poster
huskarit 0 Light Poster
laxmanpathare -1 Newbie Poster
laxmanpathare -1 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.