问题描述
在表单中,我正在使用用户控件和几个文本框.
用户控件具有2个链接标签和用户控件中控件的扩展选项卡序列(Link1,Link2,Spread).
加载表单时,最初的焦点应在Spread的第一个单元格上.
制表符序列应散布,Textbox1,textbo2,textbox3,link1,link2.
但是,最初的重点是Link1,而不是传播.然后在选项卡上,焦点导航到Link2,Spread,textbox1,textbox2,textbox3.
如何将初始焦点设置为Spread?
我们可以使用ActiveControl还是Focus?
我正在尝试ActiveControl,但不确定是否正确.
例如:
this.UserControl1.ActiveControl = this.UserControl1.Spread;
预先感谢您.
In a Form I am using a user control and few textboxes.
User control has 2 link labels and a spread Tab Sequence for Controls in User Control(Link1,Link2,Spread).
When the form loads the initial focus should be on first cell of the Spread.
Tab sequence should be spread,Textbox1,textbo2,textbox3,link1,link2.
But The inital focus is on Link1 instead of focusing on spread. Then on tabbing the focus navigates to Link2,Spread,textbox1,textbox2,textbox3.
How to set the initail focus to Spread?
Can we use ActiveControl or Focus?
I am trying ActiveControl but not sure whether it is correct way.
Ex:
this.UserControl1.ActiveControl = this.UserControl1.Spread;
Thank u in advance.
推荐答案
这篇关于如何在用户控件中设置控件的焦点,而不是其默认焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!