使用Tab键时防止控件获得焦点 [英] Preventing a control from receiving focus when using the Tab key

查看:69
本文介绍了使用Tab键时防止控件获得焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置 TextBox 控件,使其完全没有 TabIndex

How does one set a TextBox control so that it has no TabIndex at all.

我要创建它,以便用户不能进入该标签。

I want to make it so that the user can't tab into it.

[说明]

之所以问这个问题,是因为我最近从vb切换到了c#,并且正在试用QuickSharp SDK。如果使用该系统,则必须在没有Visual Studio的可视设计器的情况下构建表单-因此,没有GUI可以帮助您设置表单的所有属性。但是,这是一个很好的学习经验。

[explanation]
The reason I asked this question is because I recently switched from vb to c#, and am trying out the QuickSharp SDK. If you use that system, then you have to build your forms without Visual Studio's visual designer - hence, there is no GUI to help you in setting all the properties of the form. It's a good learning experience, however.

因此,这似乎是一个琐碎的问题,但在这种情况下,我认为这是一个合理的问题。

So, it may seem a trivial question, but under the circumstances, I think it is a legitimate question.

推荐答案

根据 MSDN :要使控件包含在Tab键顺序中,必须将其TabStop属性设置为true。

According to MSDN : For a control to be included in the tab order, its TabStop property must be set to true.

因此将TabStop属性设置为 false 会将其从TabOrder中删除

So setting the TabStop property to false should remove it from the TabOrder

这篇关于使用Tab键时防止控件获得焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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