CMonthCalCtrl as popup
Hi!
I'm trying to display a month calendar as a popup, exactly the same way as the CDateTimeCtrl dropdown does it (preferably without stealing focus from the dialog). If anyone has some example code to share, I'd be very happy to see it.
Regards / Z
[277 byte] By [
zerver] at [2007-11-20 1:18:49]

# 1 Re: CMonthCalCtrl as popup
Although not too close ;)...this ( http://www.codeproject.com/miscctrl/JgNumericEditArticle.asp) is worth a try!
# 2 Re: CMonthCalCtrl as popup
Yeah, that is a good example, but the dialog loses focus when the trackbar is displayed.
zerver at 2007-11-10 23:19:56 >

# 3 Re: CMonthCalCtrl as popup
You have pretty tough requirements!
Ok then try to derive a custom menu class from CMenu and handle WM_INITMENU, WM_INITMENUPOPUP...probably here you can associate your control say 'month calendar' with the pop up menu. I have not tried this...but hopefully should work.
# 4 Re: CMonthCalCtrl as popup
Well, I'm now able to display the calendar as a popup using this (http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_21240112.html) code but the focus problem still remains.
Sorry about the tough requirements :D but this is professional software.
Constant focusing/defocusing of the main dialog is a real annoyance if you're going to select many dates.
If someone has the complete MFC source code for CDateTimeCtrl, I'd be very interested to see how that calendar drop down functions.
Thanks
zerver at 2007-11-10 23:22:00 >

# 5 Re: CMonthCalCtrl as popup
First of all I strongly believe that Date Time picker does not create a pop up menu!
and secondly My dialog looses focus when I click on the Month calendar control!