기본카테고리

[VC++]CDasteTimeCtrl 설정

DevReff 2013. 3. 28. 22:17




728x90

// 시작시간 컨트롤 설정
 UINT stateFlags = CBCGPDateTimeCtrl::DTM_SPIN
  | CBCGPDateTimeCtrl::DTM_DROPCALENDAR
  | CBCGPDateTimeCtrl::DTM_DATE
  | CBCGPDateTimeCtrl::DTM_TIME24H;


 const UINT stateMask = CBCGPDateTimeCtrl::DTM_SPIN
  | CBCGPDateTimeCtrl::DTM_DROPCALENDAR
  | CBCGPDateTimeCtrl::DTM_DATE
  | CBCGPDateTimeCtrl::DTM_TIME24H
  | CBCGPDateTimeCtrl::DTM_CHECKBOX
  | CBCGPDateTimeCtrl::DTM_TIME
  | CBCGPDateTimeCtrl::DTM_TIME24HBYLOCALE;

 _wndDateFromTimeCtrl.Create("", WS_CHILD | WS_BORDER, rtCtrlWnd, this, m_nDateFromTimeCtlrID);
 _wndDateFromTimeCtrl.SetState(stateFlags, stateMask);

 _wndDateToTimeCtrl.Create("", WS_CHILD | WS_BORDER, rtCtrlWnd, this, m_nDateToTimeCtlrID);
 _wndDateToTimeCtrl.SetState(stateFlags, stateMask);

 _wndDateFromTimeCtrl.SetDate( COleDateTime::GetCurrentTime());// - COleDateTimeSpan( 1, 0 ,0 ,0)); 
 _wndDateToTimeCtrl.SetDate( COleDateTime::GetCurrentTime() );