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

前端 未结 9 738
[愿得一人]
[愿得一人] 2021-02-03 17:05

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?

9条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-03 17:50

    Set the ReadOnly attribute to true.

    Or if you want the combobox to appear and display the list of "available" values, you could handle the ValueChanged event and force it back to your immutable value.

提交回复
热议问题