c# 给dornetbar中combobox赋值

1.Combobox赋值,这样不会显示空值

this.comboBox1.SelectedIndex = this.comboBox1.FindString(room);

this.comboBox1.SelectedIndex = this.comboBox1.FindString(room);

这样能获得comboBox1.SelectedValue值。

this.comboBox1.SelectedText = room;

这样获得comboBox1.SelectedValue值为空。

猜你喜欢

转载自blog.csdn.net/sky_rabbit94/article/details/54983876