问题
In datetime picker control the user has to press .(period) to move to different fields (like day, month year)
I want to override this behaviour by allowing the user to enter date without entering .(period)
Is there any to achieve this programmatically in C# winforms?
Thanks in advance.
回答1:
Not very beautiful code but you could of course send the .
automatically.
Just handle the ValueChanged
event (which will only be called when the user has entered a "whole" value for date part he's currently editing) and in the event handler you add the code SendKeys.Send(".");
.
来源:https://stackoverflow.com/questions/3191972/avoid-pressing-period-key-to-move-to-next-field-in-datetime-picker-control