带有3个GroupBox的Tab键顺序不顺利 [英] tab order with 3 GroupBoxes don't go well

查看:127
本文介绍了带有3个GroupBox的Tab键顺序不顺利的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我选择标签时我使用View> Tab Order



我在窗口形式中有3个GroupBox:GroupBox A,GroupBox B,GroupBox C



GroupBox C在GroupBox B内



GroupBox B在GroupBox A内


GroupBox一个Tab顺序为0

该组框中的控件类似于0.1,0.2,0 .......



GroupBox B Tab顺序为0.0

该组框中的控件类似于0.0.1,0.0.2,0.0.3 ......



GroupBox C Tab顺序为0.0.0

该组框中的控件类似于0.0.0.1,0.0.0.2,0.0.0.3,....



当我运行表格时,我专注于GruopBox C的TextBox。



我想要的是GrouBox A,GrouBox B和GrouBox C



我该怎么办?

help。

解决方案

使用Visual Studio的设计时Tab Order工具无法实现您的目标。我认为这是Visual Studio中的一个缺陷。



如果您的外部GroupBox没有其中的TabStop属性设置为'true的控件,那么它将当你使用TabKey时,它们会被跳过显示:实际情况并非如此;他们确实收到了'输入事件。



假设你的外部GroupBoxes 里面有控件:在一个容器内的每个控件内(Form, Panel,GroupBox,UserControl等)焦点将通过每个TabKey从具有较低TabIndex的那些按下到具有较高TabIndex的那些。



这里的简单答案是在设计时,只需设置每个GroupBox的TabIndex属性,如下所示:



groupbox1 => 11 ...选择合适的起始号码

groupbox2 => 22

groupbox3 => 33

when i oder tab i use View>Tab Order

I have 3 GroupBoxes in window forms : GroupBox A , GroupBox B, GroupBox C

GroupBox C is within the GroupBox B

GroupBox B is within the GroupBox A

GroupBox A Tab Order is 0
Controls in that group box are like 0.1, 0.2, 0....

GroupBox B Tab Order is 0.0
Controls in that group box are like 0.0.1, 0.0.2, 0.0.3,....

GroupBox C Tab Order is 0.0.0
Controls in that group box are like 0.0.0.1, 0.0.0.2, 0.0.0.3,....

when i run the form i got focus in a TextBox of GruopBox C.

what i want is GrouBox A , GrouBox B and GrouBox C

what do i suppose to do ?
help.

解决方案

You can't achieve what you want here using Visual Studio's design-time Tab Order facility; I think that's a flaw in Visual Studio.

If your outer GroupBoxes have no Controls inside them that have their TabStop Property set to 'true, then it will appear to you that they are "skipped" when you use the TabKey: in reality that's not the case; they do receive an 'Enter Event.

Assuming your outer GroupBoxes do have Controls inside them: within each Control inside a Container (Form, Panel, GroupBox, UserControl, etc.) focus will pass with each TabKey pressed from those with the lower TabIndex to those with the higher TabIndex.

The simple answer here is to just, at design-time, set the TabIndex property of each of your GroupBoxes like this:

groupbox1 => 11 ... choose a starting number that's appropriate
groupbox2 => 22
groupbox3 => 33


这篇关于带有3个GroupBox的Tab键顺序不顺利的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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