Make DateTimePicker work as TimePicker only in WinForms

前端 未结 6 1729
南笙
南笙 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:28

    A snippet out of the MSDN:

    'The following code sample shows how to create a DateTimePicker that enables users to choose a time only.'

    timePicker = new DateTimePicker();
    timePicker.Format = DateTimePickerFormat.Time;
    timePicker.ShowUpDown = true;
    

提交回复
热议问题