C# DateTimePicker控件设置空时间
生活随笔
收集整理的這篇文章主要介紹了
C# DateTimePicker控件设置空时间
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
?//在DateTime旁邊添加一個清空按鈕.
private void btnClearRegTime_Click(object sender, EventArgs e){MessageBox.Show("Text:" + dtpRegTime.Text + "\nValue:" + dtpRegTime.Value.ToString());dtpRegTime.CustomFormat = " ";MessageBox.Show("Text:" + dtpRegTime.Text + "\nValue:"+dtpRegTime.Value.ToString());}?
dtpRegTime.CustomFormat = "?? ";的作用是讓dtp.Text為"" ,但dtp.value其實還是時間值。錄入數據庫的事后要使用dtp.text.
轉載于:https://www.cnblogs.com/imihiroblog/archive/2012/06/18/2553234.html
總結
以上是生活随笔為你收集整理的C# DateTimePicker控件设置空时间的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2012的学习计划
- 下一篇: 6410 gpio控制及接口