468,103 Members | 1,186 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,103 developers. It's quick & easy.

key events in a winforms custom control class

I've been building my own nullable and bindable datetimepicker class, which inherits from DateTimePicker and includes a textbox to handle any user text entry, blanking the date for null, and such. Works great and handles all my needs just fine, except for one thing: key events when the calendar is dropped down. I wanted to capture the Enter key (which would set the control value to the dtp value; and the Escape key (which would leave the control value unchanged). I'm doing all the synchronization work between Mybase.Value and the control's value at the CloseUp event and figured it would be no sweat to intercept the key events and set some flags to whatever I wanted. But no go. I've tried 'em all, from PreviewKeyDown to ProcessCmdKey and everything in between, and I never get one before Closeup. I'm sure I'm missing something simple, but have no idea what.
Dec 12 '14 #1
0 975

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Caronte | last post: by
3 posts views Thread by TIBM | last post: by
19 posts views Thread by Jamey Shuemaker | last post: by
1 post views Thread by --== Alain ==-- | last post: by
1 post views Thread by JTC^..^ | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.