using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
                       int a = this.monthCalendar1.SelectionEnd.Year;
           int b = this.monthCalendar1.SelectionEnd.Month;
           int c = this.monthCalendar1.SelectionEnd.Day;
           this.textBox1.Text=a.ToString();         }
                
    }
}
用以上代码获取年,月,日的时候,总是会提示未将对象引用设置到对象的实例,不知道 是何原因。