为什么这不起作用?为什么我在 Google 和 Bing 上找不到一个单一的答案?
private void Form1_Shown(object sender, EventArgs e)
{
checkedListBox.SelectedItem = "kshdfkjsdhf";
}
显然,所选项目不为空。也不会抛出编译或运行时异常。
最佳答案
您不能将 SelectedItem
设置为任意字符串。
您应该将 SelectedItem
设置为 ListBox
中的existing Items
之一,或者设置为 null 以清除选择.
关于c# - 更改 CheckedListBox.SelectedItem 文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28104585/