Click here to Skip to main content
15,867,704 members
Articles / Desktop Programming / WTL
Article

An MS Outlook-style mini-calendar control using WTL

Rate me:
Please Sign up or sign in to vote.
4.79/5 (20 votes)
5 Jun 20031 min read 115.8K   3.1K   45   14
An MS Outlook-style mini-calendar control using WTL

Sample Image

Introduction

This article explains an MS Outlook-style mini-calendar control using WTL.

This began as a port of Matt Gullett's MS Outlook-style miniature calendar control written for MFC. There are still some features remaining to be added to it, but it serves as a reasonable starting point for anyone needing this functionality in a WTL application.

Features

  • Display months in n-columns by m-rows
  • Single-date or date-range selection (including SHIFT-extended selection)
  • Different fonts for: header, day initials, and day numbers
  • Auto-repeat on scroll arrows
  • Auto-scroll when previous/following months' days are selected
  • Callback (via WM_NOTIFY) for highlighting 'special days'
  • Month-year selection from header popup (with drop shadow under XP)

Optional display styles include:

  • 3D border
  • Today's date highlighted
  • Previous/following months' days displayed with the months' days
  • Week can start on any day of the week

Environment

This control was developed using VC++ .NET, WTL 7, and the Feb 2003 Platform SDK. It has been tested under Windows XP only.

History

  • 22 May 2003
    • Initial release
  • 6 June 2003
    • Added month/year selection popup
    • Added 'special date' highlighting
  • Soon...?
    • Buttons (optional) for selecting today's date, and for clearing the selection
    • Provide internationalisation support
    • Make it an ActiveX component

Acknowledgements

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Australia Australia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralUse this C++ in VB project Pin
Blackboss9-May-06 1:43
Blackboss9-May-06 1:43 
Generalcompile error Pin
humbird27-Jun-05 0:06
humbird27-Jun-05 0:06 
GeneralBug in SetRange(...) Pin
vschoech4-Jul-04 23:48
vschoech4-Jul-04 23:48 
GeneralRe: Bug in SetRange(...) Pin
Tony Ioanides5-Jul-04 11:58
Tony Ioanides5-Jul-04 11:58 
Given that the control is a calendar control (ie. deals only with dates), date-times are used internally with the time part always set to 00:00:00. Any method that violates this constraint will introduce a bug.

Also, the SetRange(...) method doesn't exist in the supplied code. You suggested it as an enhancement, remember?! Check your post.
GeneralRe: Bug in SetRange(...) Pin
vschoech5-Jul-04 22:40
vschoech5-Jul-04 22:40 
GeneralForcing NotifyGetSpecialDays() Pin
vschoech13-Jan-04 0:31
vschoech13-Jan-04 0:31 
GeneralRe: Forcing NotifyGetSpecialDays() Pin
Tony Ioanides14-Jan-04 21:54
Tony Ioanides14-Jan-04 21:54 
QuestionBug ResetRange()/NotifySelChanged()? Pin
vschoech13-Jan-04 0:23
vschoech13-Jan-04 0:23 
AnswerRe: Bug ResetRange()/NotifySelChanged()? Pin
Tony Ioanides14-Jan-04 22:21
Tony Ioanides14-Jan-04 22:21 
GeneralRe: Bug ResetRange()/NotifySelChanged()? Pin
vschoech14-Jan-04 23:07
vschoech14-Jan-04 23:07 
GeneralGood work. Pin
Matt Gullett6-Jun-03 23:51
Matt Gullett6-Jun-03 23:51 
GeneralWow this is just what I have been doing the last few weeks! Pin
Angus Comber4-Jun-03 12:43
Angus Comber4-Jun-03 12:43 
General10 Pin
Hans J. Schroeder26-May-03 10:41
Hans J. Schroeder26-May-03 10:41 
GeneralNICE Pin
NormDroid21-May-03 22:44
professionalNormDroid21-May-03 22:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.