我正在制作一个“键盘操作的应用程序”,用户将只使用键盘。 用户将使用左右箭头键,有时使用向上和向下箭头键在填写表单时浏览不同的控件。为此,我使用 keydown 事件并使用 SendKeys.SendWait({TAB}) 作为右键和 SendKeys.SendWait (+{TAB}) 左键。
我有一个自定义格式为 dd/MM/yyyy 的 DateTimePicker。
When the year part is selected and the user presses the left arrow key, the focus moves to month part.当再次按下箭头键时,焦点移动到日部分。
What I want is that when the day part is selected and the user presses the left arrow key, focus should move to the previous control (SendKeys.SendWait(+{TAB})).
请提出解决方案。
最佳答案
编辑:不幸的是,标准 DateTimePicker 没有公开任何方式来判断选择了哪个元素,因此如果不创建您自己的控件就无法实现这一点。
关于c# - 日期时间选择器 Winforms : Move focus left arrow key,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6108612/