Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show "empty" TDateTimePicker

How can I show an "empty" TDateTimePicker in Delphi 2010 (that is, hide the display of the date so the control appears empty). I know about the trick of setting the format to show the epoch, but with Delphi 2010 running on Windows 7 the string "A.D." appears in the control when I do this.

like image 559
Larry Lustig Avatar asked Nov 20 '10 18:11

Larry Lustig


1 Answers

try setting the format to a blank space Value.

DateTimePicker1.Format:=' ';

and then in the OnChange method set the format again

procedure TForm1.DateTimePicker1Change(Sender: TObject);
begin
DateTimePicker1.Format:=ShortDateFormat;
end;
like image 198
RRUZ Avatar answered Oct 24 '22 19:10

RRUZ