ComboBox.SelectedText不给我的SelectedText [英] ComboBox.SelectedText doesn't give me the SelectedText
本文介绍了ComboBox.SelectedText不给我的SelectedText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我建立一个字符串,代码看起来像
字符串状态=我的组合框的状态为+ comboBoxTest .SelectedText
我使用的WinForm在VS2010
结果看起来像
我的组合框的状态是
块引用>
解决方案我想你想使用
字符串状态=我的组合框的状态为+ comboBoxTest.Text
SelectedText从的MSDN
获取或设置在
ComboBox的可编辑部分选定的文本。
块引用>
而来自 MSDN
$ b $ Text属性b
获取或设置与此控件关联的文本。
块引用>I am building a String and the code looks like
String status = "The status of my combobox is " + comboBoxTest.SelectedText
I am using WinForm in VS2010
The result looks like
"The status of my combobox is "
解决方案I think you want to use
String status = "The status of my combobox is " + comboBoxTest.Text
SelectedText property from MSDN
Gets or sets the text that is selected in the editable portion of a ComboBox.
while Text property from MSDN
Gets or sets the text associated with this control.
这篇关于ComboBox.SelectedText不给我的SelectedText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文