Make DateTimePicker work as TimePicker only in WinForms

前端 未结 6 1727
南笙
南笙 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条回答
  •  情深已故
    2020-12-08 06:49

    The best way to do this is this:

    datetimepicker.Format = DatetimePickerFormat.Custom;
    datetimepicker.CustomFormat = "HH:mm tt";
    datetimepicker.ShowUpDowm = true;
    

提交回复
热议问题