可以在ComboBox的SelectionChanged事件中,将SelectedItem设置为null即可:

private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    comboBox.SelectedItem = null;
}

这样每次选中一个新的值时,原来的SelectedItem就会被清空。

c#如何实现当更改选中的值时SelectedItem清空

原文地址: https://www.cveoy.top/t/topic/8zA 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录