VisualHint's blog

A new MonthCalendar for the DateTimePicker and the PropertyGrid

There was a miss in the DateTimePicker. The editor was able to take any CultureInfo to localize the displayed strings but the popup calendar was not, simply because SFPE was still using the Microsoft MonthCalendar which accepts only the culture of the thread. It had to be fixed so I decided to write my own calendar.

This choice was also motivated by a second category of customers who use the free Krypton Toolkit API. This framework has no DateTime components (yet). For them I had just to ensure that my calendar is skinnable. But more on this in another post.

Not to make a big change, my calendar by default looks like the MS one (+ a mouse hover effect) and has the following features:

  • It is completely free (see at the bottom). Why? Simply because this is not my business and the community needs a good one that is also supported in a commercial package
  • It can be used standalone or inside the SFPE DateTimePicker
  • It has a CultureInfo property
  • It is not limited by the fateful 1753 year but by what the DateTime type can accept
  • It can display an optional and localizable "Today" button
  • It is nullable, so it can display an optional and localizable "Clear" button too
  • There is a true continuous acceleration when keeping the month and year buttons pressed
  • An overridable drawing manager allows you to customize its look

There are some limitations for this first release, simply because I needed a simple calendar for the DateTimePicker:

  • It displays only one month (no rows and columns of months)
  • It doesn't handle range selections
  • There is no bolded dates

That said, you have nothing to loose trying it. It's free and I think this is not just another calendar component. Personaly I tried the various ones proposed by some famous component vendors and I was not so impressed. They put the accent on the nice themes, but each time I was able to find a visual glitch or an annoying limitation.

Even if you are not a VisualHint customer, you can send me feature requests and I will enhance this calendar bit by bit (here in the comments or at UserVoice). Let me know if you like it too...

Get the month calendar here (the supplied sample references the free Krypton toolkit, so if you don't want that, simply remove the reference and the corresponding code in the form class).