Shai UI
Shai UI

Reputation: 51908

How to select only years (or months) in WPF DatePicker?

I'm using the Datepicker that comes with visual studio 2010 but I can't find an option that lets me select only years, or only months of a given year.

(I see the wpf toolkit calendar supports this, but I'm wondering if maybe the one that comes with visual studio does as well?)

Upvotes: 1

Views: 6861

Answers (2)

Shai UI
Shai UI

Reputation: 51908

Duh, I should've just used the Calendar control with a popup. (Calendar supports DisplayMode)

Upvotes: 1

MethodMan
MethodMan

Reputation: 18843

will something like this work if you coded it..???

DateTime selectedDate = dateTimePicker1.Value;
int intMonth = DateTime.Month(selectedDate.Month);

Upvotes: 0

Related Questions