TabControl 中自动跳到下一个 TabPage
C# .Net fw 3.5,在TabControl中的winform中, 当用户从 TabPage 上的最后一个控件跳出时,焦点应该移动到下一页,并聚焦该页面中的第一个控件,我该怎么做?
这对我来说是必要的,因为在主条目表单中,有一些强制性问题被放置在 tabcontrol 之外,而一些控件并不是全部都在 tabcontrol 中,
如果用户顺序访问每个控件,那么焦点应该自动移动到下一个页面,如果用户只想填写必要的信息,那么他可以通过单击“保存”按钮提交。
对此有什么建议吗?
C# .Net fw 3.5, in winform in TabControl,
when the user tab out of the last control on a TabPage, then focus should moves to the next page, and focuses the first control in that page, how can i do it?
this is necessary for me because, in a master entry form, there is some compulsory questions which is placed out side of tabcontrol, and some controls which is not necessary all in tabcontrol,
if user visiting each control sequentially then focus should automatically move to next pages, if user want to fill only neccessory infos, then he can submit by clicking save button.
is any suggestion about this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的问题不准确
“C# .Net fw 3.5,在winform中的TabControl中,当用户跳出TabPage上的最后一个控件时,焦点应该移动到下一页,并聚焦该页面中的第一个控件?”
这是一个陈述还是一个问题。我不明白。您需要的目标是什么?
如果您希望用户通过按 Tab 键来访问后续选项卡中的控件,您可以通过选项卡控件中的按键事件来完成。在按键事件中,您可以通过编程方式更改选项卡。
希望有帮助。
代码应该是这样的。
为您的选项卡控件生成按键事件并监视 TAB 键的按下。
希望它足够清楚
your question is not accurate
"C# .Net fw 3.5, in winform in TabControl, when the user tab out of the last control on a TabPage, then focus should moves to the next page, and focuses the first control in that page?"
is this a statement or question. I didnt understand. And what is the goal you need ?
If you want the user consequently visit the controls inside the consequent tabs by pressing tab key you can do it by keypressed event in tab control. In the keypressed event you can change the tab programatically.
hope it helps.
The code should be something like this.
Generate keypress event for your tabcontrol and monitor the press of TAB key.
hope its clear enough