Search code examples
.netvb.netcombobox

VB.NET: how to prevent user input in a ComboBox


How do you prevent user input in a ComboBox so that only one of the items in the defined list can be selected by the user?


Solution

  • Set the DropDownStyle property of the combobox to DropDownList. This will allow only items in the list to be selected and will not allow any free-form user input.