WinForm 日期控件初始值为空
public Form1()
{
InitializeComponent();
this.dateTimePicker1.Format = DateTimePickerFormat.Custom;
this.dateTimePicker1.CustomFormat = " ";
this.dateTimePicker1.ValueChanged += new EventHandler(dateTimePicker1_ValueChanged);
}
void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
this.dateTimePicker1.Format = DateTimePickerFormat.Long;
this.dateTimePicker1.CustomFormat = null;
}
}
原文地址:http://blog.163.com/kunkun0921@126/blog/static/169204332201110422359950/

浙公网安备 33010602011771号