procedure TForm1.DateTimePicker1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key=VK_DELETE then
DateTimePicker1.Format:=' ';
end;
procedure TForm1.DateTimePicker1Change(Sender: TObject);
begin
DateTimePicker1.Format:=ShortDateFormat;
end;
在取用TDateTimePicker時,需檢查Format決定是空值還是日期值
沒有留言:
張貼留言