The title is somewhat misleading. I can reduce the .Items Count to zero by the usual methods, but the dropdown list area keeps its former dimensions.
When adding items to ComboBox manually, I can do ComboBox.Items.Clear. The ComboBox.Items count is reduced to zero.
When databinding ComboBox, I can do ComboBox.DataSource = Nothing. Or, set the BindingSource = Nothing, if using one. The ComboBox.Items Count is reduced to zero.
However, the combobox dropdown area retains the rows it had been populated with, except that they are "empty". In other words, it's a white box which is the same height as the list it had contained.
Seems to me that if I clear a ComboBox, it ought to appear identical to one which has never been bound or filled.
The DropDownStyle = DropDownList
ComboBox before filling/binding:
ComboBox after filling/binding:
ComboBox after clearing/setting datasource/bindingsource = Nothing:
Does anyone know a way to prevent this? If I unbind or otherwise clear the ComboBox, I'd like the dropdown to then consist of one empty row, as in the first image.
Thanks.