|
-
April 14th, 1999, 09:40 AM
#1
DateTime Picker and MTS_NOTODAY
I am attempting to modify the behaviour od the date time picker control so that when the user hits the drop down arrow of the calendar , the calendar is displayed without the Today date and the today circle. I have overode the DTN_DROPDOWN handler with the code shown below and I am attempting to change the style so that it excludes MTS_NOTODAY using GetWindowLong() and SetWindowLong() and the GWL_STYLE identifier. Is this the right identifier to use for common controls ? as the code seems to be having no effect.
ccode
LRESULT CImsPMQCtrl::OnDropdownDatetime_end(int idCtrl, LPNMHDR pnmh,
BOOL& bHandled)
{
HWND MCCtrlHWND;
MCCtrlHWND = (HWND)::SendMessage(m_hWNDEndDate, DTM_GETMONTHCAL, 0, 0);
long lStyle = ::GetWindowLong (MCCtrlHWND, GWL_STYLE);
lStyle &= ~MCS_NOTODAY;
lStyle &= ~MCS_NOTODAYCIRCLE;
::SetWindowLong (MCCtrlHWND, GWL_STYLE, lStyle);
return 0;
}
/ccode
-
April 22nd, 1999, 02:54 PM
#2
Re: DateTime Picker and MTS_NOTODAY
Here is how you would do it with MFC.
void CDayTimeDlg::OnDropdownDatetimepicker(NMHDR* pNMHDR, LRESULT* pResult)
{
CDateTimeCtrl * pDateTimeCtrl = (CDateTimeCtrl*)FromHandle(pNMHDR->hwndFrom);
CMonthCalCtrl * pMonthCal = pDateTimeCtrl->GetMonthCalCtrl();
pMonthCal->ModifyStyle(0, MCS_NOTODAY | MCS_NOTODAYCIRCLE);
*pResult = 0;
}
-
April 24th, 1999, 04:11 AM
#3
Re: DateTime Picker and MTS_NOTODAY
Thanks very much, It is now working correctly
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|