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

CJ7 picture CJ7 · May 5, 2010 · Viewed 154.4k times · Source

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?

Answer

DCNYAM picture DCNYAM · May 5, 2010

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.