如何在C#Window窗体中更改控件选择的顺序。我想改变表单中出现的文本框的位置,但是现在当我使用Tab键时,它将跳过该文本框并稍后转到该文本框。我和WPF一起工作过,我只是改变XAML中的控制位置,但我不能以Win的形式来完成。窗体控件选择
Q
窗体控件选择
0
A
回答
1
下面是一个简单的例子,增加了一个按钮,并设置其的TabIndex财产
// Create a button and add it to the form.
Button button1 = new Button();
// Anchor the button to the bottom right corner of the form
button1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
// Assign a background image.
button1.BackgroundImage = imageList1.Images[0];
// Specify the layout style of the background image. Tile is the default.
button1.BackgroundImageLayout = ImageLayout.Center;
// Make the button the same size as the image.
button1.Size = button1.BackgroundImage.Size;
// Set the button's TabIndex and TabStop properties.
button1.TabIndex = 1;
button1.TabStop = true;
// Add a delegate to handle the Click event.
button1.Click += new System.EventHandler(this.button1_Click);
// Add the button to the form.
this.Controls.Add(button1);
另外,您还可以看看this(从设计设置)
希望它可以帮助
+0
是的,它是TabIndex属性。谢谢 – user2081328
+1
如果它可以帮助你,请随时将其标记为答案:) – Rohit
相关问题
- 1. grails窗体可选控件
- 2. 无法在Windows窗体中选择特定控件
- 3. Jquery切换选择窗体控件禁用状态?
- 4. 展望“选择联系人”窗体:它使用什么控件?
- 5. 仅当在以前的窗体控件上使用html和php选择的值时,才显示窗体控件。
- 6. Windows窗体DatetTimePicker控件预选日期
- 7. 如何选择窗体控件中的ActiveX选项/单选按钮
- 8. C#窗体控件
- 9. Windows窗体控件
- 10. 如何选择窗体页
- 11. 选择Laravel窗体编辑
- 12. jquery按窗体ID选择
- 13. 窗体选择父水合
- 14. 窗体:sfWidgetFormDoctrineChoice,选择方法
- 15. 窗体不开启选择
- 16. jQuery窗体和选择框?
- 17. Django窗体选择变化
- 18. 子窗体内的子窗体控件
- 19. .NET窗体窗体刷新控件
- 20. 线程调用窗体窗体控件
- 21. 动态生成窗体窗体控件
- 22. 窗体之间有什么区别:选择和窗体:选项
- 23. Xcode字体选择器窗口无法选择字体集合
- 24. Spring MVC选择窗体中的值:在窗体验证错误后选择
- 25. 窗体选择选项需要
- 26. 窗体选择选项断线重叠
- 27. 弹簧窗体选项默认选择
- 28. zf2窗体禁用选择选项
- 29. Spring MVC窗体:选择所选值?
- 30. 选择窗体初始化选项卡
设置Tab索引属性,你就完成了 – Rohit