Title: How to set a date of a TDateTimePicker to blank
uses
CommCtrl;
var
FDTMDateEmpty: Boolean;
procedure TForm1.FormCreate(Sender: TObject);
begin
DateTime_SetFormat(DateTimePicker1.Handle, '''Choose a date''');
FDTMDateEmpty := True;
end;
procedure TForm1.DateTimePicker1CloseUp(Sender: TObject);
begin
DateTime_SetFormat(DateTimePicker1.Handle, PChar('dd.MM.yy'));
end;
procedure TForm1.DateTimePicker1Click(Sender: TObject);
begin
if FDTMDateEmpty then
begin
DateTimePicker1.Perform(WM_KEYDOWN, VK_F4, 0);
DateTimePicker1.Perform(WM_KEYUP, VK_F4, 0);
end;
end;
procedure TForm1.DateTimePicker1Change(Sender: TObject);
begin
FDTMDateEmpty := False;
end;