开发者

Avoid pressing . (period) key to move to next field in DateTime picker control

开发者 https://www.devze.com 2023-01-06 11:24 出处:网络
In datetime picker control the user has to press .(period) to move to differen开发者_Python百科t fields (like day, month year)

In datetime picker control the user has to press .(period) to move to differen开发者_Python百科t 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.


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(".");.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号