this.dateTimePicker.CustomFormat = "yyyy 年 MM 月";
this.dateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
设置为2月份的时候就会报错
ex;假如当前日期为2012年03月30日。当输入2月的时候,虽然日没有显示,但是实际存在,但是2月份没有30号,所以会报错。把日期设置为每月的第一天问题就解决啦。
this.dateTimePicker.CustomFormat = "yyyy 年 MM 月";
this.dateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
设置为2月份的时候就会报错
ex;假如当前日期为2012年03月30日。当输入2月的时候,虽然日没有显示,但是实际存在,但是2月份没有30号,所以会报错。把日期设置为每月的第一天问题就解决啦。