<< Return to Main Index

< Return to Class Index

CGXDateTimeCtrl::OnChanging

OnChanging(const COleDateTime& newDateTime);

newDateTime

The new date and time that are being set.

Remarks

This function will be called whenever the date/time value in the CGXDateTimeCtrl is being changed. The CGXDateTimeCtrl version returns TRUE in every case except when the control is ReadOnly in which case it returns FALSE. This function can be overridden to return FALSE for any reason.

BOOL CGXDateTimeCtrl::OnChanging(const COleDateTime& /* newDateTime */)

{

……….

// Return FALSE if you want to abort the change

//Check for ReadOnly

if (m_pStyle->GetIncludeReadOnly()&& m_pStyle->GetReadOnly())

return FALSE;

else

{

SetModify(TRUE);

return TRUE;

}

return TRUE;

}

See Also

CGXControl::OnValidate CGXControl::ValidateString

CGXDateTimeCtrl

Class Overview | Class Members