标签索引不适用于面板中的控件吗? [英] Tab index does not work with controls in panels?

查看:88
本文介绍了标签索引不适用于面板中的控件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个vb.net Windows窗体,其中包含约15个组合框和15个文本框,以及其他几个控件.所有这些TextBoxesComboBoxes都位于面板中.原因是我需要根据用户选择/输入的内容来调整控件的可见属性,因此将每个标签和控件组合在自己的面板中似乎是实现此目的的简便方法.

I have a vb.net windows form with about 15 comboboxes and 15 textboxes, along with several other controls. All of these TextBoxes and ComboBoxes are located in panels. The reason for this is I need to adjust the visible property of controls based upon what the user selects/enters, so grouping each label and control together in their own panels seemed like an easy way to accomplish this.

我已经通过属性设置了制表符顺序,但是它不起作用.当我在表单中进行制表时,它会跳过并且不遵循我设置的制表顺序.这是因为我的控件分别位于单独的面板中吗?我已将TabStop设置为false,以表示所有不需要的制表符,我对这里发生的事情感到有些困惑.实际上,我的ComboBoxesTextBoxes都位于自己的面板中,这实际上阻止了我的选项卡索引正常工作.任何人都可以确认这一点或对可能发生的事情有其他想法吗?如果创建新表单,TabIndex会起作用.

I've set the tab order via properties, but it doesn't work. When I tab through my form, it skips around and does not follow the tab order that I've set. Is this because my controls are each located in separate panels? I've set TabStop to false for everything I don't want a tabstop on, I'm a little confused about what's going on here. It really seems that the fact that my ComboBoxes and TextBoxes are each inside their own panels is preventing my tab indices to work. Can anyone confirm this or have other ideas of what may be happening? TabIndex works if I create a new form.

推荐答案

信不信由你,该面板的排序绝对会影响TabIndex.我发现处理多面板表单上的选项卡排序的最简单方法是使用LarsTech建议的查看">选项卡排序".然后,在标签顺序可见之后,您将能够看到面板如何影响每个面板中包含的控件的整体顺序.接下来,按照您希望流程进行的顺序,一次在实际面板上单击鼠标左键一次.您会注意到,它随后将自动对每个面板中的控件进行子排序,面板的整体排序将按照您指定的顺序进行.完成此操作后,您可以单击每个面板内的每个控件,以在给定面板内设置控件的相对选项卡顺序.

Believe it or not, the panel ordering absolutely DOES affect the TabIndex. I have found that the easiest way to deal with tab ordering on a multi-panel form is to use View>Tab Order as suggested by LarsTech. Then once the tab ordering is visible, you'll be able to see how the panels affect the overall ordering of the controls contained in each panel. Next, left-click one at a time on the actual panels, in the order that you want the flow to go. You'll notice that it will then automatically sub-order the controls inside each panel, with the overall panel ordering be in the order that you specified. Once this is done you can then click on each control inside each panel to set a control's relative tab order inside a given panel.

这篇关于标签索引不适用于面板中的控件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆