我现在想得到 Date Time Picker控件的选中状态
但是不知到用那个函数 
请知道的大侠指点一下 

解决方案 »

  1.   

    MSDN啊,帮助里面有个索引,在索引里输入CDateTimeCtrl就可以知道Date Time Picker控件有哪些成员函数了
    如果要去你选中的时间的话,可以用CDateTimeCtrl::GetTime(LPSYSTEMTIME pTimeDest)来取啊
      

  2.   

    你要知道控件的什么选中状态啊,为什么要得到DateTime的控件的选中状态啊
      

  3.   

          利用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!"));   
            }   
      

  4.   

    这些是可以获取复选框的状态!可是这里还有一个问题当复选框选中时DWORD这个值为0,可以把复选框选中时DWORD值为1?
    谢谢!~!!!!!