如何在 Visual Studio 9 中保持当前选定子窗体中的 Tab 键顺序?
我正在处理一份旧的工作申请,而选项卡顺序一团糟。首先我应该注意到,有很多很多(甚至嵌套了 4 层...)带有多个选项卡的子表单。应用程序中有两个并排的主要子表单。现在,我知道如何在当前选择的子表单(恰好位于左侧)中设置选项卡顺序,但问题是当它到达所选子表单中的最后一个字段时,它会跳转到右侧的第二个子表单并开始遍历每个字段。
理想情况下,我希望选项卡保留在当前选择的子表单中,因此它只会在该特定表单的字段之间循环。这可能吗?
感谢任何帮助,提前致谢!
I'm working on a hand me down application for work and the tabbing order is a mess. First I should note that there are many, many (even 4 layers nested...) sub-forms with multiple tabs. There are two main sub-forms side by side in the app. Now, I know how to set the tab order within my currently selected sub-form (which happens to be on the left side), but the problem is when it reaches the last field in my selected sub-form, it jumps over to the second sub-form on the right side and starts going through each of those fields.
Ideally, I would like the tabbing to stay within my currently selected sub-form, so it will just cycle between the fields in that particular form. Is this possible?
Any help is appreciated, thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有更多选择,这里有两个:
每个子表单都有它绑定的一些数据上下文?将控件的 IsTabStop 附加到某个属性,并在更改子表单时对其进行管理。
在活动子窗体的主控件上按下 Tab 按键。注册到 PreviewKeypress,如果该键是 TAB,并且当前控件是子窗体的最后一个,请将焦点放在第一个控件上并使用 isHandled 吃它。
You have more options, here are two:
Each subform has some datacontext it binds to? Attach the IsTabStop of controls to some property for that and manage that as you change subforms.
Eat the Tab keypress on the main control of you active subform. Register to the PreviewKeypress and if the key is a TAB, and the current control is the last of your subform put focus to the first and eat it with isHandled.