Try the below Code:
private void dateTimePickerHolidayToDate_ValueChanged(object sender, EventArgs e)
DateTime fromdate = Convert.ToDateTime(dateTimePickerFromDate.Text);
DateTime todate1 = Convert.ToDateTime(dateTimePickerToDate.Text);
if (fromdate1 <= todate1)
TimeSpan daycount = todate1.Subtract(fromdate1);
int dacount1 = Convert.ToInt32(daycount.Days) + 1;
txtDay.Text = Convert.ToString(dacount1);
MessageBox.Show("From Date Must be Less Than To Date");
Hope it helps you.
i used date time picker custom control initialy this picker value is"" and this cutom control dont have valuechanged event
If you don't have value changed event then do the validation on submit button click event. Since this is windows application it doesn't matter where you are doing the validation.
Asheej T K
i removed that date time picker custom control and used date time picker and text box. i put text box on date time picker and shown date time piker select option than i got this value changed event but it not works properly so i used close up event it works with Ankit logic