Hi Zoran,
I need your advice again. I tried to modify my application so that the DateTime Picker displays a placeholder, unless a valid date and time is entered.
I created a small demo project, and everything worked fine.
Then I tried to bring the changes over into my productive project. The DateTime picker is initialized like this in FormCreate:
DateTimePickerBirthday.NullInputAllowed := True;
DateTimePickerBirthday.TextForNullDate := 'tt.mm.jjjj';
DateTimePickerBirthday.DateTime := NULLDATE;
Nevertheless the DateTimePicker displays "30.12.1894", which seems to be the equivalent of DateTime := 0.
Using the debugger (oh my, I love open source ...) I tracked the problem to the third line of my code.
According to the debugger and my best confidence (I have never redefined NULLDATE), when that call is made, the Value of NULLDATE is 1,699999e+308. If I press F7 to step into your DateTimePicker source, my call arrives at
procedure TCustomDateTimePicker.SetDateTime(const AValue: TDateTime);
and according to the debugger the Value of AValue has changed to 0. Your IsNullDate function returns "false", and the TextForNullDate is never displayed, but "30.12.1894".
Any idea why the value of AValue changes miraculously, and what I can do about it?
Thx
Armin.