菜鸟问题 如何得到 Date Time Picker控件的复选框的状态 我现在想得到 Date Time Picker控件的选中状态但是不知到用那个函数 请知道的大侠指点一下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 MSDN啊,帮助里面有个索引,在索引里输入CDateTimeCtrl就可以知道Date Time Picker控件有哪些成员函数了如果要去你选中的时间的话,可以用CDateTimeCtrl::GetTime(LPSYSTEMTIME pTimeDest)来取啊 你要知道控件的什么选中状态啊,为什么要得到DateTime的控件的选中状态啊 利用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!")); } 这些是可以获取复选框的状态!可是这里还有一个问题当复选框选中时DWORD这个值为0,可以把复选框选中时DWORD值为1?谢谢!~!!!!! c1061错误, 请问如何能实现 在listbox中显示树 数据库连接问题(火急) 各位大哥大姐帮忙呀!!!关于jpeg压缩的几大问题!!! 问个ScrollWindow的问题 关于PostMessage在DLL中的使用问题 请大侠帮忙? 请问那位老乡有mpeg4压缩标准的源代码,或者是哪个网站上有 outlook2003插件问题,急! 怎样编辑exe文件里边的网站链接 VC获取系统时间 UpdateAllViews函数的第2参数如何确定
如果要去你选中的时间的话,可以用CDateTimeCtrl::GetTime(LPSYSTEMTIME pTimeDest)来取啊
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!"));
}
谢谢!~!!!!!