By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,846 Members | 1,449 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,846 IT Pros & Developers. It's quick & easy.

DateTimePicker - Disable user from using arrow keys?

P: n/a

I want to force the user to only use the drop down and calendar to
select a date in the DatetimePicker control.

I do NOT want them to select the control, then use the up and down
arrow keys to change the date.

How can I prevent them using the arrow keys?

Any help much appreciated.


Feb 21 '08 #1
Share this Question
Share on Google+
2 Replies

P: n/a
private void dateTimePicker1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)

if (e.KeyCode.ToString() == "Down" || e.KeyCode.ToString() == "Up")

Feb 21 '08 #2

P: n/a

"Alcides" <al************@hotmail.comwrote in message
if (e.KeyCode.ToString() == "Down" || e.KeyCode.ToString() ==
if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Up)

Feb 22 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.