c# - 组合框/列表框选择的项目

标签 c# selected

有没有更简单的方法来获取组合框(WinForms)选择的项目文本?

string result = comboBox1.Items[comboBox1.Selectedindex];

在 WPF 的 ComboBox 中呢?

最佳答案

关于

string result = (string)comboBox1.SelectedItem

这样更简单吗?

关于c# - 组合框/列表框选择的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2460389/

相关文章:

c# - 如何保持选中的项目? - 列表显示

c# - 使用 JSON.Net 序列化数据的问题

c# - 如何防止方法在 C# .NET 中接受 2 false bool?

c# - 如何让 LINQ 返回集合中具有最大值的对象的索引?

c# - 使用C#从Formstack获取提交的数据?

java - JTree 创建新文件使其被选中

jquery - if (day = day select) 在 jQuery 中

c# - 我怎样才能从这个 SQLite 操作中减少脂肪?

drop-down-menu - polymer 1.0 : How can I get the value of the selected item in a paper-dropdown-menu?

c# - 当鼠标按住单元格时,如何在 DataGridView 中维护选定的行?