Make DateTimePicker work as TimePicker only in WinForms

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;

And for anyone who wants to know what it looks like:

enter image description here

Leave a Comment