Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CDateTimeCtrl::SetRange

 

Sets the minimum and maximum allowed system times for a date and time picker control.


      BOOL SetRange(
   const COleDateTime* pMinRange,
   const COleDateTime* pMaxRange 
);
BOOL SetRange(
   const CTime* pMinRange,
   const CTime* pMaxRange 
);

pMinRange

A pointer to a COleDateTime object or a CTime object containing the earliest time allowed in the CDateTimeCtrl object.

pMaxRange

A pointer to a COleDateTime object or a CTime object containing the latest time allowed in the CDateTimeCtrl object.

Nonzero if successful; otherwise 0.

This member function implements the behavior of the Win32 message DTM_SETRANGE, as described in the Windows SDK. In MFC's implementation, you can specify either COleDateTime or CTime usages. If the COleDateTime object has a NULL status, the range will be removed. If the CTime pointer or the COleDateTime pointer is NULL, the range will be removed.

Example

See the example for CDateTimeCtrl::GetRange.

Requirements

Header: afxdtctl.h

Show: