I've just stumbled across a couple of great problems with the default WinForms DateTimePicker control:
Within an application I'm building I need to be able to represent a NullDate. Previously I've always used Date.MinValue to indicate whether or not a date has been specifyed, but after data binding a date property to the DateTimePicker I suddenly found out that Date.MinValue = 00:00:00 01/01/0001, and the DateTimePicker only supports dates after 00:00:00 01/01/1753.
Fair enough I thought I can understand the logic in that (kind of), so I created a constant within my application called 'NullDate' that returns 00:00:00 01/01/1800, which whilst it isn't ideal, does solve the problem.
But now I have the problem that the DateTimePicker (even though it's being fed a 4 digit year), believes that 00:00:00 01/01/1800 actually equals 00:00:00 01/01/2000. Argh! Now I need to figure out why! I could understand it if I was passing in a 2 digit date, but not a 4 digit one.
I'll update this post if/when I find a solution.
Right it looks like it's to do with the property being databound to an object. If I set the 'Value' or 'Text' property manually it displays the correct date, however when an object is databound to the 'Text' property it shows the wrong century. I'm guessing that the DateTimePicker is performing Property.ToString() to get the value from the object rather than Property.ToString(CustomFormat), i.e. Property.ToString("dd/MM/yyyy").
Change the 'Short Date' settings on the machine to dd/MM/yyyy instead of the UK default of dd/MM/yy.