dateTimePicker总是显示时间,我想把它设为空,我用dateTimePicker.text=""; 可是没有用啊 ,

解决方案 »

  1.   

    那个值不是text 是value 在属性栏里看得见!!
      

  2.   

    这个值是Datetime类型的,不能为空的,但是可以通过属性让它加个CheckBox为不选中的状态~
      

  3.   

    或者把dateTimePicker的Format设置为Custom,然后把 CustomFormat设置为空。
    代码如下:dateTimePicker1.Format = DateTimePickerFormat.Custom;
    dateTimePicker1.CustomFormat = "-";
      

  4.   

    我也用到了dateTimePicker 但是我重写了这个控件而已,让它和TextBox组合。
    用TextBox遮住dateTimePicker,这样里面的值你想怎么设就怎么设!
    不过我这个方法有点麻烦就是了
      

  5.   

    我也用到了dateTimePicker 但是我重写了这个控件而已,让它和TextBox组合。
    用TextBox遮住dateTimePicker,这样里面的值你想怎么设就怎么设!
    不过我这个方法有点麻烦就是了