Some people aren't happy with the DateTimePicker and MonthView controls that come with VB6. They'd like to use the Calendar from MSCAL.OCX, but this control is not really approved for use in VB6 programs and more importantly hasn't been redistributable for a long time - if ever.
Oddly enough some searching I did failed to turn up examples of straightforward Calendar clone efforts. Everyone seems to want to make something jazzier: exta bells and whistles, clashing color schemes, etc. So here we have Kal, a replacement or alternative to MS Calendar.
This is a quick and dirty attempt at an alternative to the Calendar control that is part of MS Office. It is written in 100% VB6 (and should compile in VB5 as far as I know) with no risky subclassing or other stunts. But this is also one of those "don't need it until you need it" kinds of things. I'm not claiming Kal is particularly special, and if you find a better clone go ahead and post a link to it below this post.
The main limitation is that Data Binding has not been implemented, but this should be a simple matter to add if you need it.
Being quick and dirty, there may be bugs in it yet. There is also a lot of room for optimization and code cleanup here. The idea was to get something put together fast, so if nothing else it may serve as a platform for you to start with... or at least give you some ideas.
I've added a few minor extensions, like more color properties and a NewValue event triggered on any date change. I don't think I missed too many things, but be sure to read the comments at the head of the Kal.ctl module!
As far as I know it is working fine. You can just add the Kal control (and its KalDayCell sub-control) files to your Projects. Or you could add them to a new OCX Control Project and expose Kal and the Enums and make your own reusable Calendar control library.
Kal should be close to a drop-in replacement for MSCAL as it stands.
Sample project attached along with full source.
Known glitch, Should be fixed now:
Compiling the sample project from the command line (or by right-click, Make) results in a "failed to load control, see Form1.log for details" abort. Compiling from within the IDE works fine though.
Last edited by dilettante; Aug 17th, 2011 at 10:45 AM.
Reason: Fixed the errors preventing command-line compiles