You can do the following in the datetimepicker control in vb.net.
1. You can restrict the date to a custom format. Look for a customFormat option in the properties, where you could set values like mm/dd/yyyy, dd/mm/yyyy..,.etc
2. You can use the MinDate and MaxDate properties to restrict the boundary of dates, that can be selected in the datetimepicker control.
3. You can set the datetime format in the "Format" Property of the datetimepicker control.
4. And you can validate the dates in the CloseUp Event like this.
Private Sub dtBeginDatePicker_CloseUp(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtBeginDatePicker.CloseUp
If Me. dtBeginDatePicker.Value > Me. dtEndDatePicker.Value Then
Me. dtEndDatePicker.Value = Me. dtBeginDatePicker.Value
End If
End Sub
Private Sub dtEndDatePicker_CloseUp(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtEndDatePicker.CloseUp
If Me.dtEndDatePicker.Value < Me.dtBeginDatePicker.Value Then
Me.dtBeginDatePicker.Value = Me.dtEndDatePicker.Value
End If
End Sub