焦点文本框在WindowsForm中明智地排序 [英] Focus text boxes order wise in WindowsForm

查看:65
本文介绍了焦点文本框在WindowsForm中明智地排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在Windows窗体中有5个文本框,并且通过使用code:textbox1.select();集中了第一个文本框;在d页面加载及其工作中.但是我的问题是,我想通过TAB键选择第二个文本框,第三个文本框等,但是控件没有选择下一个,而是选择了第四个.因此,请为此提供帮助.

hi all,

i''ve 5 text-boxes in Windows Form and i focused first text box by using code:textbox1.select(); in d page load and its working.But my question is, i want to select 2nd text box,3rd text box and so on by TAB Key,but control is not selecting next one instead selecting 4th one. So please help me out in that.

推荐答案

您应该使用一个名为"TabIndex"的属性.
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.tabindex.aspx [ ^ ]
您也可以直接在表单编辑器中对其进行更改.
您可以将textBox1的TabIndex设置为1,依此类推.
如果要在代码中执行此操作,则可以使用:
There is a propery called "TabIndex" that you should use.
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.tabindex.aspx[^]
You can also change it directly in the forms editor.
You can just set the TabIndex of textBox1 to 1 and so on.
If you want to do it in code then you could use:
textBox1.TabIndex = 1;
textBox2.TabIndex = 2;
textBox3.TabIndex = 3;
...


您需要为所有文本框顺序设置标签索引.
You need to set the tab index sequentially for all the text boxes.


这篇关于焦点文本框在WindowsForm中明智地排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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