ComboBox.SelectedText 不给我 SelectedText [英] ComboBox.SelectedText doesn't give me the SelectedText

查看:18
本文介绍了ComboBox.SelectedText 不给我 SelectedText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个字符串,代码如下

I am building a String and the code looks like

String status = "The status of my combobox is " + comboBoxTest.SelectedText

我在 VS2010 中使用 WinForm

I am using WinForm in VS2010

结果看起来像

我的组合框的状态是"

推荐答案

我想你想用

String status = "The status of my combobox is " + comboBoxTest.Text

来自 MSDN 的 SelectedText 属性

SelectedText property from MSDN

获取或设置在 a 的可编辑部分中选择的文本组合框.

Gets or sets the text that is selected in the editable portion of a ComboBox.

来自 MSDN

获取或设置与此控件关联的文本.

Gets or sets the text associated with this control.

这篇关于ComboBox.SelectedText 不给我 SelectedText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆