设置属性:
Format=Custom
加载事件:ValueChanged
private void dtpStart_ValueChanged(object sender, EventArgs e)
{//日期默认为空
this.dtpStart.CustomFormat = null;
}
在_load事件中:
this.dtpStart.Format = DateTimePickerFormat.Custom;
this.dtpStart.CustomFormat = " ";//中间要有空格
Format=Custom
加载事件:ValueChanged
private void dtpStart_ValueChanged(object sender, EventArgs e)
{//日期默认为空
this.dtpStart.CustomFormat = null;
}
在_load事件中:
this.dtpStart.Format = DateTimePickerFormat.Custom;
this.dtpStart.CustomFormat = " ";//中间要有空格