Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何循环遍历 wpf 表单中的一组组合框并找到具有选定值的组合框?所有的组合框都在一个名为 BoxContainer 的网格容器中。
像这样:
foreach (var comboBox in BoxContainer.Children.OfType<ComboBox>()) if (comboBox.SelectedItem != null) MessageBox.Show(comboBox.Name);