I am trying to check an entered time in a DateTimePicker control and correct it to the closest acceptable value in C#
if (Summer1.Value.TimeOfDay > Summer2.Value.TimeOfDay)
Summer1.Value.TimeOfDay = Summer2.Value.TimeOfDay;
It gives me the following:
Property or indexer 'System.DateTime.TimeOfDay' cannot be assigned to -- it is read only
Why does it handle the DateTimePicker object as a system time? I could not find anything related to Read-Only state of the control in VS 2003.