Please faithfuls,
I ve been vein problems with the properties of the combo box.
wat i really want is disallow users to type into my combobox ( I want them to be limited to the items in the combo)
10qs.

Recommended Answers

All 3 Replies

set in the comboxbox properties the dropdownstyle to dropdownlist

In the Combobox keyPress event add this:

e.KeyChar = ChrW(0)
Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox4.KeyPress
        e.KeyChar = ChrW(0)
    End Sub

Regards.

commented: Very nice trick +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.