vc 中添加 时间控件,尤其是小时分钟控件
来源:互联网 发布:易语言网络验证源码 编辑:程序博客网 时间:2024/06/07 23:47
Project -》Add to Project
插入 Microsoft Date and Time Picker Control 控件
然后 Controls里面就会多出一个控件来,
拉一个到对话框中, 其ID为 IDC_DATETIMEPICKER1
然后设置其格式。。。
下面是参考的
http://topic.csdn.net/u/20080315/12/AE6C4745-AF7B-4BBD-AA9F-D6F299DA2367.html
=========================
没有必要去insert 额外的控件,
vC自带的标准控件 date time picker 就足够了。
Example
void CDatesDlg::OnButton2()
{
// Gain a pointer to the control
CDateTimeCtrl* pCtrl = (CDateTimeCtrl*) GetDlgItem(IDC_DATETIMEPICKER1);
ASSERT(pCtrl != NULL);
// The control will create itself with a format that matches the
// locale setting in Control Panel. But we can force a particular
// format with a call to SetFormat(). This call forces the format
// dd-MMM-yy, which would show 03-APR-98 for April 3rd, 1998.
pCtrl->SetFormat(_T("dd-MMM-yy hh:mm"));
}
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, 1996 would be displayed as "96").
"yyyy" The full year (that is, 1996 would be displayed as "1996").
- vc 中添加 时间控件,尤其是小时分钟控件
- 日历控件 小时 分钟
- VC中动态添加控件
- VC中动态添加控件
- VC中动态添加控件
- VC中动态添加控件
- VC中动态添加控件
- VC中动态添加控件
- VC中动态添加控件
- VC中动态添加控件
- VC中动态添加控件
- VC中添加串口控件 添加timer
- JS 日历控件 带小时分钟
- VC++控件之时间控件
- Yii时间控件的使用(包括小时、分钟、秒的插件)
- 强大的JS日期/时间选择控件(精确到天、小时、分钟都可以)
- VC中添加web控件的方法
- VC中动态添加控件映射事件
- glscene学习(一)
- 内存句柄HGLOBAL
- 查询历史销售记录
- 两个VOIP相关问题
- C#中使用系统热键
- vc 中添加 时间控件,尤其是小时分钟控件
- 成为最牛程序员的五大要诀
- DIV+CSS网页布局对SEO有的影响
- JavaWeb中关于JSValidation(验证框架)
- Asp.Net 网站性能优化 缓字决 (上) 缓冲写数据
- Foxmail 收件人地址乱码原因之一
- C# 登录窗口与主窗口
- Doxygen支持中文注释的方法
- 职场成功的秘诀-自信心