如何使一个不可见的文本框不专注于制表符? [英] How to make an invisible textbox not to get focus on tabbing?

查看:79
本文介绍了如何使一个不可见的文本框不专注于制表符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在Windows应用程序中,
我有一个textbox1,通过选择单选按钮使其不可见,并使另一个textbox2可见.
当我选择单选按钮时,在选项卡上我应该将焦点移到textbox2上,但textbox1会获得焦点,在下一个选项卡上textbox2会获得焦点.

Hi,

In windows application ,
I have a textbox1 which I make it invisible on selecting a radio button and make another textbox2 visible.
when I select the radio button, on tabbing i should get focus to textbox2 but the textbox1 gets focus and on next tab textbox2 gets focus.

How to make the invisible textbox not to get focus on tabbing?

推荐答案

也许您并没有真正隐藏控件,相反,您只是通过显示另一个控件来遮挡它控制在上面吗?那可以解释为什么它得到关注.如果是这样,解决方案是通过将Visible 设置为false来真正隐藏它.
Perhaps you are not really hiding the control, and instead you just obscure it from view by showing another control above it? That may explain why it gets focus. If so, the solution is to actually hide it by setting Visible to false.


textBox1.TabStop = false;

您也可以在textbox1的属性窗口中找到它.
textBox1.TabStop = false;

you can find it on textbox1''s properties window too.


amcanomer的答案是正确的.但是,如果控件不可见,则控件将始终不参与选项卡导航(或任何其他聚焦活动),因此您完全不必处理这种情况.

—SA
The Answer by amcanomer is correct. However, if control is not visible, it will not participate in tab navigation (or any other focusing activity) anyway, so you don''t have to handle the situation at all.

—SA


这篇关于如何使一个不可见的文本框不专注于制表符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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