Friday, November 12, 2010

A couple of tricks when using the standard WPF .NET4 DatePicker control - CodeProject

 This is actually a pretty simple article, and to be honest I ummed and ahhed about even making this an article at all, I thought it might make a 1/2 decent blog post, but in the end I thought that it would benefit more people as a published article, so I decided to publish this dead simple article as an article and not a blog post, sorry for its shortness, I know it's not my normal style article, but hope that is ok, I just felt it was useful is all.
So what does the attached code actually do. Well it is dead simple, it shows you how to modify the standard .NET 4.0 WPF DatePicker control to allow the user to use the keyboard up/down keys to skip days/months/years when the mouse is in the correct portions of the DatePicker text, which is something the standard control does not actually do. It also takes into account any blacked out dates that may currently be applied, and also shows you how to create a custom Calendar style, such that you can place a "Go To Today" button on it.

So that is what we are trying to do, as I say dead simple, but suprisingly useful, and something that does not come out of the box, and some folk may not know how to do this, so I thought it was worth writing up.

A couple of tricks when using the standard WPF .NET4 DatePicker control - CodeProject
Enhanced by Zemanta

No comments: