tags:

views:

262

answers:

1

I am looking for a month selector control for a .net 2 winform.

+3  A: 

Use DateTimePicker. You can use a custom format to enable just the month and year to be specified.

Example:

DateTimePicker dateTimePicker1 = new DateTimePicker();
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = "MM yyyy";
dateTimePicker1.ShowUpDown = true; // to prevent the calendar from being displayed

See this MSDN article for more information.

Edit:
To prevent the calendar from being displayed, set the ShowUpDown property on the DateTimePicker to true. This will prevent the calendar from being displayed and (in conjunction with a CustomFormat) allow you to set just the month and year by using the up/down buttons.

Donut
any way to disable the day selection and just show the month and year?
Brad
See edit; does that accomplish the effect you want?
Donut