private void datePicker1_LostFocus(object sender, RoutedEventArgs e) { DateTime StartDate = new DateTime(2011, 4, 1); DateTime EndDate = new DateTime(2011, 4, 1); DatePicker dDate = (DatePicker)sender; //DateTime ddate = dDate.DisplayDate; if ((dDate.DisplayDate >= StartDate) && dDate == null) // && (StartDate <= dDate.DisplayDate)) { MessageBox.Show("good"); } else { MessageBox.Show("bad"); e.Handled = true; } }
LostFocus
Validating
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)