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

前端 未结 9 685
[愿得一人]
[愿得一人] 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:34

    Private Sub ComboBox4_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ComboBox4.KeyPress
        e.keyChar = string.empty
    End Sub
    

提交回复
热议问题