如何让datetimepicker中的框中不显示任何日期呀?

netbir 2005-08-05 04:44:43
如何让datetimepicker中的框中不显示任何日期呀?
我想通过这个方法来表示日期尚未输入或日期求知
谢谢!
...全文
519 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangguan007 2005-08-17
  • 打赏
  • 举报
回复
Format property (TDateTimePicker)

Delphi syntax:

property Format: String;

C++ syntax:

__property AnsiString Format = {read=FFormat, write=SetFormat};

Description

Format specifies custom format string for the date-time display, overriding the control panel strings. A custom format can include both date and time fields, but time fields are not editable unless the Kind property is dtkTime. The following format characters are understood.

Element Description
d The one- or two-digit day.
dd The two-digit day. Single-digit day values are preceded by a zero.
ddd The three-character weekday abbreviation.
dddd The full weekday name.
h The one- or two-digit hour in 12-hour format.
hh The two-digit hour in 12-hour format. Single-digit values are preceded by a zero.
H The one- or two-digit hour in 24-hour format.
HH The two-digit hour in 24-hour format. Single-digit values are preceded by a zero.

m The one- or two-digit minute.
mm The two-digit minute. Single-digit values are preceded by a zero.
M The one- or two-digit month number.
MM The two-digit month number. Single-digit values are preceded by a zero.
MMM The three-character month abbreviation.
MMMM The full month name.
t The one-letter AM/PM abbreviation (that is, AM is displayed as "A").
tt The two-letter AM/PM abbreviation (that is, AM is displayed as "AM").
yy The last two digits of the year (that is, 2001 would be displayed as "01").

yyyy The full year (that is, 2001 would be displayed as "2001").

To include literal strings in the format, enclose them in single quotes. Failing to quote literal strings can have unpredictable results, even if they do not include formatting codes. Use two single quotes to represent one single quote character in literal string. For example,

'Today''s date:' MMM dd, yyyy

entered in the property editor, produces the following results for April 1, 2001: "Today's date: Apr 01, 2001".

When setting Format programmatically in Delphi code, double each single quote again:

DateTimePicker1.Format := '''Today''''s date:'' MMM dd, yyyy';


无语。
netbir 2005-08-17
  • 打赏
  • 举报
回复
DateTimePicker是没有Format属性的
qufo 2005-08-07
  • 打赏
  • 举报
回复
我一般写上 Dtpicker1.datetime=now();
yaccor 2005-08-06
  • 打赏
  • 举报
回复
用Format来控制
jixinming 2005-08-06
  • 打赏
  • 举报
回复
ding
wangguan007 2005-08-06
  • 打赏
  • 举报
回复
虽然不显示日期,但日期的值还是有的

所以要通过Format的值来判断
wangguan007 2005-08-06
  • 打赏
  • 举报
回复
Form1.DateTimePicker1.Format:= ' '; //将Format属性设为空格

就看不见日期了

在程序中可以控制日期的显示

具体的Format的内容看帮助吧
hangguojun 2005-08-06
  • 打赏
  • 举报
回复
怎么又开新贴,那个贴不结了么
chenxingyuan 2005-08-06
  • 打赏
  • 举报
回复
用wwdbdatetimepicker控件好了。不错的
hqhhh 2005-08-05
  • 打赏
  • 举报
回复
恐怕不行,
换控件吧!
lw549 2005-08-05
  • 打赏
  • 举报
回复
Kint := dtkTime
zsjzwj 2005-08-05
  • 打赏
  • 举报
回复
用DBDateTimeEditEh

828

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧