There’s a great code sample in this post:
DateTimePicker automatically move to next datepart
which shows how to clean up some of the behavior of the DateTimePicker in .NET. Unfortunately the code won’t compile, since .NET can’t understand the WM_KEYDOWN type stuff. I was able to google and get values for a lot of the constants, like
WM_KEYUP = 0x0101;
But I’m really stuck getting NMHDR and WM_REFLECT to work. Is there some sort of Win32 assembly I need to add to my project to get all of this to work?
Thanks!
You need to use what is known as P/Invoke.
http://www.pinvoke.net/default.aspx/Constants/WM.html
http://www.pinvoke.net/default.aspx/Structures/NMHDR.html