在 MonthCalendar 中选择特定日期

use*_*234 0 c# select date monthcalendar

是否可以使用变量自动定位月历中的某个日期?

DateTime example = Convert.ToDateTime("01/01/2014");

//Automatically select 1 January 2014 in the calendar
//(i.e. The date corresponding to the example variable above)
Run Code Online (Sandbox Code Playgroud)

huM*_*pty 5

使用MonthCalendar.SetDate方法

DateTime example = Convert.ToDateTime("01/01/2014"); 
monthCalendar.SetDate(example);
Run Code Online (Sandbox Code Playgroud)