How to Close the DateTimePickerAdvs Drop Down by Hitting ENTER key or ESC key in Windows Forms DateTimePickerAdv(Classic)

28 Apr 2021 / 1 minute to read

This page explains How to close the DateTimePickerAdv’s Drop-Down by hitting ENTER key or ESC key and more details.

How to close the DateTimePickerAdv’s Drop-Down by hitting ENTER key or ESC key

If you want to close the DateTimePickerAdv’s drop-down, when you hit the ENTER key or the ESC key, you need to set DateTimePickerAdv.WantEnterKey property to false.

this.dateTimePickerAdv1.Calendar.WantEnterKey = false;
Me.dateTimePickerAdv1.Calendar.WantEnterKey = False