Make DateTimePicker work as TimePicker only in WinForms

前端 未结 6 1720
南笙
南笙 2020-12-08 06:01

How to restrict DateTimePicker to select the time only? I don\'t know how to disable calendar control which drops when you press the button at the right of

6条回答
  •  -上瘾入骨i
    2020-12-08 06:39

    You want to set its 'Format' property to be time and add a spin button control to it:

    yourDateTimeControl.Format = DateTimePickerFormat.Time;
    yourDateTimeControl.ShowUpDown = true;
    

提交回复
热议问题