【发布时间】:2012-02-20 07:20:52
【问题描述】:
我在我的项目中使用 Winform 和 MySQL。
当我尝试以不同的方法获取 ComboBox Vales 时,我看到 ComboBox Selected Text Propriety 为空。
为什么它是空的?。
请说出 b/w ComboBox Selected Item 和 Selected text 的区别?
【问题讨论】:
我在我的项目中使用 Winform 和 MySQL。
当我尝试以不同的方法获取 ComboBox Vales 时,我看到 ComboBox Selected Text Propriety 为空。
为什么它是空的?。
请说出 b/w ComboBox Selected Item 和 Selected text 的区别?
【问题讨论】:
SelectedItem 是用户选择的组合框项目,而SelectedText 属性包含项目文本的可能选定部分。
在您的示例中,“CITY”是所选项目的字符串表示形式。如果用户只在组合框的文本区域中选择“IT”(如果可能的话),这就是SelectedText 的值。
【讨论】: