tab框的tab tab属性 [英] tab stop property for group box

查看:195
本文介绍了tab框的tab tab属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows应用程序组框中没有制表符停止属性但是标签索引属性在那里..



请给我建议如何停止groupbox制表符停止。 ..

In Windows Application for group box there is no tab stop property but tab index property is there..

pls give me suggestion how to stop groupbox tab stop...

推荐答案

没有真正的标签到组框的概念 - 组框内的控件将按其标签索引顺序获得焦点,而不是GroupBox本身



请注意,对于每个组框,组框内控件的选项卡索引从索引0开始。



如果您不希望组框中的控件在用户点击Tab键时获得焦点,那么您可以将每个控件的TabStop属性设置为false(使用控制groupBox的集合)例如

There is no real concept of tabbing into a group box - the controls within the group box will get the focus in their tab index order, not the GroupBox itself

Note that the tab index of the controls within the group box start at index 0 for each group box.

If you don't want the controls within the group box to get focus when the user hits the Tab key then you can set the TabStop property of each of the controls to false (use the Controls collection of the groupBox) e.g.
foreach (Control c in this.groupBox1.Controls)
                c.TabStop = false;









你可以设置将GroupBox的Enabled属性设置为false



OR

You could just set the Enabled property of the GroupBox to false


只是添加到CHill60所说的内容:除非直接接受键盘输入,否则不能将TabStop与任何控件一起使用 - Textbox,CheckBox,RadioButton,Button等等 - 因为tab键只能进入这样的控件 - 如果用户无法输入数据,将键盘焦点设置为它是愚蠢的!



所以GroupBox,Panel,UserControl,Label,ListView,DataGridView等没有TabStop属性只是因为他们不接受键盘输入。



他们有一个Tab订单,因为它是一个不同的属性,用于不同的目的 - 指定控件的组织顺序。例如,如果你有两个texbox和一个标签你可以使用'&'字符通过正确设置TabOrder将焦点设置到其中一个Texbox上

Just to add to what CHill60 said: you can't use TabStop with any control unless it accept keyboard input directly - Textbox, CheckBox, RadioButton, Button and so forth - because the tab key can only go to such controls - if the user can't enter data, it is silly to set the keyboard focus to it!

So GroupBox, Panel, UserControl, Label, ListView, DataGridView etc. do not have a TabStop property simply because they do not accept keyboard input.

They have a Tab Order, because that is a different property, used for a different purpose - to specify the order in which controls are organised. For example, if you have two texboxes and a label you can use the '&' character to set the focus to one of the Texboxes by setting the TabOrder correctly
Control Name: TB1     LABEL     TB2
Text        : ....    User&Name ....
Tab Order   :  4        5        6

然后按住ALT并按'N'将将键盘输入设置为TB2,因为系统将查找下一个最高TabOrder值。

Then holding down ALT and pressing 'N' will set the keyboard input to TB2, because the system will look for the next highest TabOrder value.


这篇关于tab框的tab tab属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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