Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subclass a MonthCal control in Win32

Objective: use the standard Win32 MonthCal control, and paint days such as holidays in RED.

It seems like the Win32's native approach would be use the MCN_GETDAYSTATE notification, which seems to allow only painting specific days in Bold.

Possible (but declined) solution would be to write my own painted-at-will MonthCalendar, driving myself right out of the theme support - meaning that chances are my control will not be UI consistent when newer themes are out there.

If anyone have come across this issue, a solution would be much appreciated.


1 Answers

Well if your application doesn't use any MFC, but is written in pure win32 calls, an MFC control to do what you want is out of the question. So you can make a control with MFC or with win32 - obviously the MFC control will use win32 under the hood but 15 years of Windows developer convention says that when someone talks about a 'win32 control', it's a control that 'only uses win32 calls, no external libraries' and an 'MFC control' is 'a control that directly or indirectly derives from CWnd and uses the MFC classes and usage patterns'.

Anyway, look at http://www.bcgsoft.com/samples/calendar.htm. They have a control in their UI suite that looks like the MonthCal control, but where you can indicate date ranges etc. with colors.

like image 161
Roel Avatar answered Dec 11 '25 15:12

Roel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!