Question Compare Date

zahir

Member
Joined
Apr 9, 2009
Messages
9
Programming Experience
1-3
How to compare DateTimePicker1 with DateTimePicker2?
For example i wanted DateTimePicker1 must always be smaller than DateTimePicker2...

example
DateTimePicker1 > DateTimePicker2
'display message box error

Please help me...
:(:(:(
 
hi zahir...
here is the solution code...

Private Sub DateTimePicker2_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker2.ValueChanged
If DateTimePicker2.Value < DateTimePicker1.Value Then
MessageBox.Show("DateTimePicker2 value should be always greaterthan datetimepicker1")
End If
End Sub

I hope it'll help u.
 
Back
Top