how to validate date time picker(custom control) for from date to to date
how to validate date time picker "from date" to "To date " and To date should not be greater than From date . me using date time picker its a custom control developed by someone it not contain "valuechanged event" and close up event". initially this

EhteshamPosted Oct 11, 2012, 7:42 AM
DateTime startdate = StartdateTimePicker.Value;
DateTime enddate = EnddateTimePicker.Value;
int v = startdate.CompareTo(enddate);
switch (v)
{
case -1:
MessageBox.Show("Valid");
break;
case 0:
MessageBox.Show("both dates are equal");
break;
case 1:
MessageBox.Show("Invalid");
break;
}