DateTimePicker控件为空 分类: WinForm 2014-04-15 09:46 239人阅读 评论(0) 收藏
设置属性:
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 = " ";//中间要有空格
版权声明:本文为博主原创文章,未经博主允许不得转载。
***** Jackerson *****
I love you not for who you are, but because of who I am when I'm by your side.

浙公网安备 33010602011771号