关于DateTimePicker控件Show None属性的问题
来源:互联网 发布:3000电钢琴 推荐 知乎 编辑:程序博客网 时间:2024/05/26 22:08
利用Show None属性可以设置是否选择日期,内含一个CheckBox,使用CheckBox 属性能够指定控件是否返回日期。缺省情况下,CheckBox 的值为False,并且控件总是返回一个日期。如果CheckBox属性设为True,那么在控件日期和时间左边的编辑部分中将出现一个小的复选框。如果这个复选框没有被选中,那么Value属性返回一个空值。如果选中了这个复选框,那么控件通过Value属性返回当前显示日期。
可以通过以下方式获得CheckBox是否选中的状态:
CString strYear = _T("");
CString strMonth = _T("");
CString strDay = _T("");
CTime timeTime;
DWORD dwResult = m_ctrValidTime.GetTime(timeTime);
if (dwResult == GDT_VALID)
{
strYear.Format("%d", timeTime.GetYear());
strMonth.Format("%d", timeTime.GetMonth());
strDay.Format("%d", timeTime.GetDay());
strYear = strYear.Right(2);
if ( strMonth.GetLength() == 1 )
{
strMonth = _T("0") + strMonth;
}
if ( strDay.GetLength() == 1 )
{
strDay = _T("0") + strDay;
}
m_strValidTime = strYear + strMonth + strDay;
m_strValidTime.TrimLeft();
m_strValidTime.TrimRight();
AfxMessageBox("你选中了checkbox时间是" + strValidTime );
}
else
{
AfxMessageBox(_T("你没有选中了checkbox!"));
}
更多技术文章请参看施昌权的个人网站: http://www.joyvc.cn
- 关于DateTimePicker控件Show None属性的问题
- DateTimePicker控件的问题
- 关于datetimepicker初始化的问题
- 关于mfc 对话框 DATETIMEPICKER控件的使用
- datetimepicker控件问题
- datetimepicker 控件验证问题
- 关于Bootstrap日期控件datetimepicker被模态框等遮罩在底部的问题及解决办法。
- 关于struts2中datetimepicker显示的问题。
- [VB.NET]请教!!!关于DateTimePicker的问题....
- 关于datetimepicker时间格式的问题
- 关于android 控件的默认属性问题
- DateTimePicker控件的用法
- datetimepicker控件的使用
- C# Form.Hide()后再 Show()时,Dock不为 none的 控件将不会显示。
- 关于递归 return none的问题
- 关于WM中时间控件的使用(DateTimePicker)
- 关于display的block、inline-block、none属性
- C# WinForm中DateTimePicker控件的Text属性和Value属性
- 程序员35岁之前成功12条法则
- Google历年的愚人节创意一览
- Lenovo completes sales of handset unit 联想把手机业务转让了
- 什么是32位os.
- mysql 主从配置
- 关于DateTimePicker控件Show None属性的问题
- vc中显示bmp常用的几个函数介绍
- Linux下面的编译和连接
- 1900*1200 高清水滴涟漪桌面
- HTML连续英文字符串强制换行
- php超级功能,汉字转拼音
- 单片机执行程序的过程
- [连载]VC++深入详解(孙鑫视频)第5章-文本编程 笔记
- iis 经常出现的问题以及解决方案