The Calendar that comes with .NET is good but there are so many times I wanted a calendar control that lets the user add entries right on the calendar. The ability to add text to a day on a calendar is important and makes the computer version seem much more like the paper one. It annoyed me that .NET didn’t have one and after a search I couldn’t seem to find anything worth using so as a good little programmer I wrote my own.

Here is what it looks like: (click for a bigger version)

The current day is shown in blue, and any day with an event automatically gets an orange border. The user can just click on a day and start typing. When a user edits a day like this it fires an event you can monitor and save the information to a file or database etc…

The control is “lookless”, so if you don’t like how i’ve skinned it you can easily modify the theme file and provide your own skin.

When I first started writing this project I thought it would take quite a bit of code, now that i’m done I’m surprised as how simple and small the project turned out to be.

You’ll notice I use an ItemsControl, this is to iterate the ObservableCollection of day objects, and I’ve changed the default ItemsPanelTemplate to use a UniformGrid so that as you resize the control the days all stay the same height and width.

Keep in mind as the comments in the files suggest this does not support globalization, so in places such as Australia where the week begins on Monday instead of Sunday it will not work. It should be easy enough to remedy though if your interested.

Also notice this control has no error handling. If you plan to use this in production you will want to add some. While your at it you might need to test it on odd scenarios such as leap-years as I have not done so.