gpt4 book ai didi

c# - ComboBox.SelectedText 没有给我 SelectedText

转载 作者:IT王子 更新时间:2023-10-29 03:49:44 26 4
gpt4 key购买 nike

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

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

我在 VS2010 中使用 WinForm

结果是这样的

"The status of my combobox is "

最佳答案

我想你想用

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

来自 MSDN 的 SelectedText 属性

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

虽然 Text 属性来自 MSDN

Gets or sets the text associated with this control.

关于c# - ComboBox.SelectedText 没有给我 SelectedText,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10194171/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com