别告诉把datetimepicker拉短就行了~~

解决方案 »

  1.   

    用它的SetFormat函数设置。下面是你要的:CDateTimeCtrl m_datetime;m_datetime.SetFormat("yyyy-MM");格式字符串自己选,不清楚看msdn就知道了
      

  2.   

    同上,nkgd说的对
    就是给这个控件定义个控制变量,比如m_DD
    然后用
    m_DD.SetFormat("yyyy-MM");
    就可以了
      

  3.   

    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("yyyy-mm"));