将 tabItems-.Header 添加到列表<T>



我的TabControl中有多个TabItemstabItem1tabItem2tabItem3。。。它们是CCD_ 6。如果所有选项卡项都是活动的,我如何将tabItem.Header添加到List<string>

        List<string> listItems = new List<string>();
        foreach (TabItem item in tabControl1.Items)
        {
            if (item.IsEnabled)
                listItems.Add(item.Header.ToString());
        }

最新更新