DatatimePicker中要输入日期比较麻烦,能不能在datatimepicker中默认显示为
'    -  -  ',键盘只要输入2004325, 就显示为'2004-3-25'?    急,谢谢高人们!

解决方案 »

  1.   

    FormatDataTime()
    你想要什么样就什么呀,具体自己看帮助...
      

  2.   

    第一步要设置
    DateTimePicker1.ParseInput := true;然后,你可以设置
    procedure TForm1.DateTimePicker1Enter(Sender: TObject);
    begin
     DateTimePicker1.Format := 'yyyyMdd';
    end;procedure TForm1.DateTimePicker1Exit(Sender: TObject);
    begin
     DateTimePicker1.Format := 'yyyy-M-dd';
    end;
      

  3.   

    楼主可看看delphi自带的那个示例:MastApp程序,把它那个程序里的Edit控件改成MastEdit,会挺好的
      

  4.   


    用:
    maskedit自定义一个形式吧!
      

  5.   

    就用这个 FormatDataTime()