I'm looking for a MonthPicker control, a control just like a DatePicker but that you can only select the month and the year.
Before start writing one from scrath I would like to know if something like this exists.
I have used System.Windows.Controls.Calendar in this way:
(that's in Hebrew, but I'd guess you got the Idea...)
XAML:
<Calendar Name="dteSelectedMonth" DisplayMode="Year" SelectionMode="None"
DisplayModeChanged="dteSelectedMonth_DisplayModeChanged" />
Code behind to keep calendar on Year mode:
private void dteSelectedMonth_DisplayModeChanged(object sender, CalendarModeChangedEventArgs e)
{
dteSelectedMonth.DisplayMode = CalendarMode.Year;
}
And I've used dteSelectedMonth.DisplayDate value to get the selected month.
You might want to insert that Calendar into an Expander or a ComboBox with binding to SelectedMonth
Finally made my own. It needs some polish, but works:
Usercontrol VB code at https://dl.dropboxusercontent.com/u/16351501/MonthPicker.zip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With