代码之家  ›  专栏  ›  技术社区  ›  Larry Lustig

显示“空”TdateTimePicker

  •  11
  • Larry Lustig  · 技术社区  · 14 年前

    如何在Delphi2010中显示“空”TDateTimePicker(即,隐藏日期显示,使控件显示为空)。我知道设置格式来显示时代的诀窍,但是当Delphi2010在Windows7上运行时,字符串“a.d.”会出现在控件中。

    3 回复  |  直到 8 年前
        1
  •  14
  •   RRUZ    14 年前

    format

    DateTimePicker1.Format:=' ';
    

    OnChange

    procedure TForm1.DateTimePicker1Change(Sender: TObject);
    begin
    DateTimePicker1.Format:=ShortDateFormat;
    end;
    
        2
  •  1
  •   Andriy M    12 年前

    DateTimePicker1.Format := '__/__/____';
    

        3
  •  0
  •   Michael Vincent    8 年前

    TJvDateTimePicker NullDate NullText

    dtpOne.NullDate := 0;
    dtpOne.NullText := ' '; // empty string doesn't work