简体   繁体   English

如何使CDateTimeCtrl具有字符串作为默认值?

[英]How to make CDateTimeCtrl have a string as default value?

I am using MFC CDateTimeCtrl in VS2010. 我在VS2010中使用MFC CDateTimeCtrl。 It seems it always has a datetime value showed, default one is today. 似乎总是显示日期时间值,默认值是今天。 I want sort of customizing it. 我想对它进行自定义。 Would it be possible that to make it show a string say "no date selected" when it shows up first time? 第一次显示时是否可以显示“未选择日期”这样的字符串? After that, when the end user picks up a date, show the corresponding date. 之后,当最终用户选择一个日期时,请显示相应的日期。

Thanks 谢谢

基础控件支持“无值”,但显示一个复选框,允许指定(或不指定)数据。

可能您需要创建自己的自定义控件或将CDateTimeCtrl子类化并覆盖其行为

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更改SysDateTimePick32或CDateTimeCtrl的背景颜色? - How to change background color of SysDateTimePick32 or CDateTimeCtrl? 他们如何使“获取Windows 10”图标默认具有“显示图标和通知”可见性? - How did they make “Get Windows 10” icon to have “Show icon and notifications” visibility by default? 如何使编辑控件具有3D外观? - How to make edit controls have 3D look? 如何使Win32对话框出现在默认位置(CW_USEDEFAULT)? - How to make a Win32 dialog appear at the default position (CW_USEDEFAULT)? 如何在Windows中将特定字体的默认字体提到特定字体? - How to mention a specific font as default for a particular unicode value in windows? 如何使Systray图标默认在Win7 / 8中更加明显 - How to make Systray icon by default more visible in Win7/8 如何在C ++中将std :: string值传递给RegSetValueEx() - How to pass std::string value to RegSetValueEx() in C++ Windows是否有默认的单词字典? - Does Windows have a default word dictionary? timeEndPeriod是否恢复上一个或默认值? - Does timeEndPeriod restore the previous or the default value? 这是在Windows中使自定义控件透明且无闪烁的方式吗? 还是我将这些步骤之一弄错了? - Is this how I make custom controls both transparent and flicker-free in Windows? Or do I have one of these steps wrong?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM