更新时间:2023-12-06 17:29:04
您是否尝试过TabControl.SelectedIndex
属性?如果要选择第三个选项卡,它将如下所示:
Did you try theTabControl.SelectedIndex
property? If you want to select the 3rd tab, it would go like this:
tabControl1.SelectedIndex = 2;
我确实提出了一个解决方案(对此不太满意),但确实可以.
基本上,我在主模块中创建了一个索引变量,并使用它来跟踪在特定选项卡控件下选择的tabItem.然后,只要我选择其他tabControl,就使用保存的索引选择tabItem.
问候
I did come up with a solution ( not very satisfied with it) but it does work.
Basically I created an index variable in the main module and used it to keep track of the tabItem selected under a specific tab control. Then used the saved index to select the tabItem whenever I select a different tabControl.
Regards,