我有一个winform窗体,其中我添加了一个2行2列的表格布局面板。 我在每个单元格中添加了不同的用户控件,并为它们设置了自己的tab索引顺序。但问题是似乎tab索引与整个窗体相关联,也就是说:
UserControl1 has 4 textboxes with tab index: 0,1,2,3
UserControl2 has 4 textboxes with tab index: 0,1,2,3
UserControl3 has 4 textboxes with tab index: 0,1,2,3
UserControl4 has 4 textboxes with tab index: 0,1,2,3
当我在UserControl1文本框1中按下tab键时,它跳到了UserControl2的文本框1,而不是跳到UserControl1的文本框2。 所有的控件都是动态加载的,所以tab索引是在循环中计算的。 有没有办法告诉表单只按照用户控件的顺序来处理tab键,而不是表单的顺序?